summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclStringObj.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 78a47e3..af72e13 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -70,8 +70,8 @@ static void SetUnicodeObj(Tcl_Obj *objPtr,
static int UnicodeLength(const Tcl_UniChar *unicode);
static void UpdateStringOfString(Tcl_Obj *objPtr);
-#define ISCONTINUATION(bytes) ((bytes) \
- && ((((bytes)[0] & 0xC0) == 0x80) || (((bytes)[0] == '\xED') \
+#define ISCONTINUATION(bytes) (\
+ ((((bytes)[0] & 0xC0) == 0x80) || (((bytes)[0] == '\xED') \
&& (((bytes)[1] & 0xF0) == 0xB0) && (((bytes)[2] & 0xC0) == 0x80))))
@@ -1225,7 +1225,7 @@ Tcl_AppendLimitedToObj(
/* If appended string starts with a continuation byte or a lower surrogate,
* force objPtr to unicode representation. See [7f1162a867] */
- if (ISCONTINUATION(bytes)) {
+ if (bytes && ISCONTINUATION(bytes)) {
Tcl_GetUnicode(objPtr);
}
if (stringPtr->hasUnicode && stringPtr->numChars > 0) {
@@ -1428,7 +1428,7 @@ Tcl_AppendObjToObj(
/* If appended string starts with a continuation byte or a lower surrogate,
* force objPtr to unicode representation. See [7f1162a867]
* This fixes append-3.4, append-3.7 and utf-1.18 testcases. */
- if (ISCONTINUATION(appendObjPtr->bytes)) {
+ if (ISCONTINUATION(TclGetString(appendObjPtr))) {
Tcl_GetUnicode(objPtr);
}
/*
@@ -3084,7 +3084,7 @@ TclStringCat(
*/
binary = 0;
- if (ov > objv+1 && ISCONTINUATION(objPtr->bytes)) {
+ if (ov > objv+1 && ISCONTINUATION(TclGetString(objPtr))) {
forceUniChar = 1;
} else if ((objPtr->typePtr) && (objPtr->typePtr != &tclStringType)) {
/* Prevent shimmer of non-string types. */