diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-04-14 08:41:20 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-04-14 08:41:20 (GMT) |
commit | c25f03ae3af39ea8ab9781a18daaf53c7622290a (patch) | |
tree | 4e85f1f0739df4f27e5b6702138bae535a09a451 /generic | |
parent | a02901a8b46ce085a0f8871bbd11cf14f68e024a (diff) | |
parent | e83fde690fb80b952bc835f68b00256f42f0b002 (diff) | |
download | tcl-c25f03ae3af39ea8ab9781a18daaf53c7622290a.zip tcl-c25f03ae3af39ea8ab9781a18daaf53c7622290a.tar.gz tcl-c25f03ae3af39ea8ab9781a18daaf53c7622290a.tar.bz2 |
Merge tip-597
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclBasic.c | 4 | ||||
-rw-r--r-- | generic/tclCmdMZ.c | 2 | ||||
-rw-r--r-- | generic/tclStringObj.c | 10 |
3 files changed, 6 insertions, 10 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c index aa6d203..5ca70d4 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -3684,7 +3684,6 @@ CallCommandTraces( } } cmdPtr->flags |= CMD_TRACE_ACTIVE; - cmdPtr->refCount++; result = NULL; active.nextPtr = iPtr->activeCmdTracePtr; @@ -3742,9 +3741,6 @@ CallCommandTraces( */ cmdPtr->flags &= ~CMD_TRACE_ACTIVE; - cmdPtr->refCount--; - /* Don't free cmdPtr here, since the caller of CallCommandTraces() - * is responsible for that. See Tcl_DeleteCommandFromToken() */ iPtr->activeCmdTracePtr = active.nextPtr; Tcl_Release(iPtr); return result; diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index e7ca828..6f71198 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -3314,7 +3314,7 @@ TclInitStringCmd( #if TCL_MAJOR_VERSION < 9 && !defined(TCL_NO_DEPRECATED) {"bytelength", StringBytesCmd, TclCompileBasic1ArgCmd, NULL, NULL, 0}, #endif - {"cat", StringCatCmd, NULL/*TclCompileStringCatCmd*/, NULL, NULL, 0}, + {"cat", StringCatCmd, TclCompileStringCatCmd, NULL, NULL, 0}, {"compare", StringCmpCmd, TclCompileStringCmpCmd, NULL, NULL, 0}, {"equal", StringEqualCmd, TclCompileStringEqualCmd, NULL, NULL, 0}, {"first", StringFirstCmd, TclCompileStringFirstCmd, NULL, NULL, 0}, 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. */ |