diff options
author | apnadkarni <apnmbx-wits@yahoo.com> | 2024-05-27 16:10:03 (GMT) |
---|---|---|
committer | apnadkarni <apnmbx-wits@yahoo.com> | 2024-05-27 16:10:03 (GMT) |
commit | 24fb8aad9c612f54ae1b00bb7874fa49126ed8f6 (patch) | |
tree | 76a7fbff6c7f61b6061fd7f084dc03a131cdba10 /generic | |
parent | b7b512c7b27d4eae512d39ce11b4cbb633f3d665 (diff) | |
parent | bac8bdb8bb12e32bbec2724e1ce04959ce13bb8f (diff) | |
download | tcl-24fb8aad9c612f54ae1b00bb7874fa49126ed8f6.zip tcl-24fb8aad9c612f54ae1b00bb7874fa49126ed8f6.tar.gz tcl-24fb8aad9c612f54ae1b00bb7874fa49126ed8f6.tar.bz2 |
Merge trunk
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclEncoding.c | 8 | ||||
-rw-r--r-- | generic/tclInt.h | 2 | ||||
-rw-r--r-- | generic/tclInterp.c | 13 | ||||
-rw-r--r-- | generic/tclPkg.c | 6 | ||||
-rw-r--r-- | generic/tclUtil.c | 13 |
5 files changed, 26 insertions, 16 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 0844303..73b4f54 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -407,7 +407,7 @@ Tcl_SetEncodingSearchPath( if (TCL_ERROR == TclListObjLength(NULL, searchPath, &dummy)) { return TCL_ERROR; } - TclSetProcessGlobalValue(&encodingSearchPath, searchPath, NULL); + TclSetProcessGlobalValue(&encodingSearchPath, searchPath); return TCL_OK; } @@ -482,7 +482,7 @@ FillEncodingFileMap(void) Tcl_DecrRefCount(directory); } Tcl_DecrRefCount(searchPath); - TclSetProcessGlobalValue(&encodingFileMap, map, NULL); + TclSetProcessGlobalValue(&encodingFileMap, map); Tcl_DecrRefCount(map); } @@ -1778,7 +1778,7 @@ OpenEncodingFileChannel( map = Tcl_DuplicateObj(map); Tcl_DictObjRemove(NULL, map, nameObj); - TclSetProcessGlobalValue(&encodingFileMap, map, NULL); + TclSetProcessGlobalValue(&encodingFileMap, map); directory = NULL; } } @@ -1812,7 +1812,7 @@ OpenEncodingFileChannel( map = Tcl_DuplicateObj(TclGetProcessGlobalValue(&encodingFileMap)); Tcl_DictObjPut(NULL, map, nameObj, dir[i]); - TclSetProcessGlobalValue(&encodingFileMap, map, NULL); + TclSetProcessGlobalValue(&encodingFileMap, map); } } diff --git a/generic/tclInt.h b/generic/tclInt.h index ed8336b..938090c 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3576,7 +3576,7 @@ MODULE_SCOPE void TclSetCmdNameObj(Tcl_Interp *interp, Tcl_Obj *objPtr, Command *cmdPtr); MODULE_SCOPE void TclSetDuplicateObj(Tcl_Obj *dupPtr, Tcl_Obj *objPtr); MODULE_SCOPE void TclSetProcessGlobalValue(ProcessGlobalValue *pgvPtr, - Tcl_Obj *newValue, Tcl_Encoding encoding); + Tcl_Obj *newValue); MODULE_SCOPE void TclSignalExitThread(Tcl_ThreadId id, int result); MODULE_SCOPE void TclSpellFix(Tcl_Interp *interp, Tcl_Obj *const *objv, Tcl_Size objc, Tcl_Size subIdx, diff --git a/generic/tclInterp.c b/generic/tclInterp.c index 5fbefbf..e38ec2b 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -2842,6 +2842,18 @@ ChildEval( Tcl_Preserve(childInterp); Tcl_AllowExceptions(childInterp); + /* + * If we're transferring to another interpreter, check it's limits first. + * It's much more reliable to do that now rather than waiting for the + * intermittent checks done during running; the slight performance hit for + * a cross-interp call is not a big problem. [Bug e3f4a8b78d] + */ + + if (interp != childInterp && Tcl_LimitCheck(childInterp) != TCL_OK) { + result = TCL_ERROR; + goto done; + } + if (objc == 1) { /* * TIP #280: Make actual argument location available to eval'd script. @@ -2860,6 +2872,7 @@ ChildEval( result = Tcl_EvalObjEx(childInterp, objPtr, 0); Tcl_DecrRefCount(objPtr); } + done: Tcl_TransferResult(childInterp, result, interp); Tcl_Release(childInterp); diff --git a/generic/tclPkg.c b/generic/tclPkg.c index 50884a1..ef9c30d 100644 --- a/generic/tclPkg.c +++ b/generic/tclPkg.c @@ -537,11 +537,7 @@ PkgRequireCoreStep1( Tcl_NRAddCallback(interp, PkgRequireCoreStep2, reqPtr, INT2PTR(reqc), (void *) reqv, NULL); - Tcl_NREvalObj(interp, - Tcl_NewStringObj(Tcl_DStringValue(&command), - Tcl_DStringLength(&command)), - TCL_EVAL_GLOBAL); - Tcl_DStringFree(&command); + Tcl_NREvalObj(interp, Tcl_DStringToObj(&command), TCL_EVAL_GLOBAL); return TCL_OK; } diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 0fcecbf..e2c96a9 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -4121,8 +4121,7 @@ FreeProcessGlobalValue( void TclSetProcessGlobalValue( ProcessGlobalValue *pgvPtr, - Tcl_Obj *newValue, - Tcl_Encoding encoding) + Tcl_Obj *newValue) { const char *bytes; Tcl_HashTable *cacheMap; @@ -4144,7 +4143,7 @@ TclSetProcessGlobalValue( } bytes = TclGetString(newValue); pgvPtr->numBytes = newValue->length; - Tcl_UtfToExternalDStringEx(NULL, encoding, bytes, pgvPtr->numBytes, + Tcl_UtfToExternalDStringEx(NULL, NULL, bytes, pgvPtr->numBytes, TCL_ENCODING_PROFILE_TCL8, &ds, NULL); pgvPtr->numBytes = Tcl_DStringLength(&ds); pgvPtr->value = (char *)Tcl_Alloc(pgvPtr->numBytes + 1); @@ -4153,7 +4152,7 @@ TclSetProcessGlobalValue( if (pgvPtr->encoding) { Tcl_FreeEncoding(pgvPtr->encoding); } - pgvPtr->encoding = encoding; + pgvPtr->encoding = NULL; /* * Fill the local thread copy directly with the Tcl_Obj value to avoid @@ -4277,6 +4276,8 @@ TclGetProcessGlobalValue( * This function stores the absolute pathname of the executable file * (normally as computed by TclpFindExecutable). * + * Starting with Tcl 9.0, encoding parameter is not used any more. + * * Results: * None. * @@ -4289,9 +4290,9 @@ TclGetProcessGlobalValue( void TclSetObjNameOfExecutable( Tcl_Obj *name, - Tcl_Encoding encoding) + TCL_UNUSED(Tcl_Encoding)) { - TclSetProcessGlobalValue(&executableName, name, encoding); + TclSetProcessGlobalValue(&executableName, name); } /* |