diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-03-24 10:48:44 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-03-24 10:48:44 (GMT) |
commit | 4e3426067cddf752f0c15e8a2ce29f5f9052341f (patch) | |
tree | 71bc7b9e28e2dd0b30a055ea917d68cf355039f9 /generic/tclTestObj.c | |
parent | 66cbd6ac71e01082f9e8b0e088cd829defdf9886 (diff) | |
download | tcl-4e3426067cddf752f0c15e8a2ce29f5f9052341f.zip tcl-4e3426067cddf752f0c15e8a2ce29f5f9052341f.tar.gz tcl-4e3426067cddf752f0c15e8a2ce29f5f9052341f.tar.bz2 |
When compiled with TCL_NO_DEPRECATED, remove the UTF16 compatibility layer. So, we make sure that it is never used internally for the Core. This means that extensions using the compatibility layer won't work any more in this mode; extensions should be compiled using TCL_UTF_MAX=4 then they work again.
Diffstat (limited to 'generic/tclTestObj.c')
-rw-r--r-- | generic/tclTestObj.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c index 9884a9a..223eb98 100644 --- a/generic/tclTestObj.c +++ b/generic/tclTestObj.c @@ -1264,10 +1264,14 @@ TeststringobjCmd( goto wrongNumArgs; } if (varPtr[varIndex] != NULL) { - Tcl_ConvertToType(NULL, varPtr[varIndex], - Tcl_GetObjType("string")); - strPtr = (String *)varPtr[varIndex]->internalRep.twoPtrValue.ptr1; - length = (int) strPtr->allocated; + const Tcl_ObjType *objType = Tcl_GetObjType("string"); + if (objType != NULL) { + Tcl_ConvertToType(NULL, varPtr[varIndex], objType); + strPtr = (String *)varPtr[varIndex]->internalRep.twoPtrValue.ptr1; + length = (int) strPtr->allocated; + } else { + length = -1; + } } else { length = -1; } @@ -1318,10 +1322,14 @@ TeststringobjCmd( goto wrongNumArgs; } if (varPtr[varIndex] != NULL) { - Tcl_ConvertToType(NULL, varPtr[varIndex], - Tcl_GetObjType("string")); - strPtr = (String *)varPtr[varIndex]->internalRep.twoPtrValue.ptr1; - length = strPtr->maxChars; + const Tcl_ObjType *objType = Tcl_GetObjType("string"); + if (objType != NULL) { + Tcl_ConvertToType(NULL, varPtr[varIndex],objType); + strPtr = (String *)varPtr[varIndex]->internalRep.twoPtrValue.ptr1; + length = strPtr->maxChars; + } else { + length = -1; + } } else { length = -1; } |