diff options
| author | kjnash <k.j.nash@usa.net> | 2022-08-31 14:28:57 (GMT) |
|---|---|---|
| committer | kjnash <k.j.nash@usa.net> | 2022-08-31 14:28:57 (GMT) |
| commit | 19f8c3bb6b2aa8d571a7534b588ddacfb49952d3 (patch) | |
| tree | 5051f34456c20c798d30e7741fae52575927fd7a /generic/tclEnsemble.c | |
| parent | d9b5be0959a8ee2b81ba519ff3d4c70b2da9a6ce (diff) | |
| parent | ff1e919a1bae9ff88ab6dbc094b18cfadedfe8af (diff) | |
| download | tcl-19f8c3bb6b2aa8d571a7534b588ddacfb49952d3.zip tcl-19f8c3bb6b2aa8d571a7534b588ddacfb49952d3.tar.gz tcl-19f8c3bb6b2aa8d571a7534b588ddacfb49952d3.tar.bz2 | |
Merge old 8.7 674a6ad0472c7
Diffstat (limited to 'generic/tclEnsemble.c')
| -rw-r--r-- | generic/tclEnsemble.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 3c99631..23516f8 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -2909,7 +2909,7 @@ TclCompileEnsemble( DefineLineInformation; Tcl_Token *tokenPtr = TokenAfter(parsePtr->tokenPtr); Tcl_Obj *mapObj, *subcmdObj, *targetCmdObj, *listObj, **elems; - Tcl_Obj *replaced = Tcl_NewObj(), *replacement; + Tcl_Obj *replaced, *replacement; Tcl_Command ensemble = (Tcl_Command) cmdPtr; Command *oldCmdPtr = cmdPtr, *newCmdPtr; int len, result, flags = 0, i, depth = 1, invokeAnyway = 0; @@ -2917,6 +2917,7 @@ TclCompileEnsemble( unsigned numBytes; const char *word; + TclNewObj(replaced); Tcl_IncrRefCount(replaced); if (parsePtr->numWords < depth + 1) { goto failed; @@ -3161,7 +3162,7 @@ TclCompileEnsemble( } /* - * Now we've done the mapping process, can now actually try to compile. + * Now that the mapping process is done we actually try to compile. * If there is a subcommand compiler and that successfully produces code, * we'll use that. Otherwise, we fall back to generating opcodes to do the * invoke at runtime. @@ -3261,9 +3262,9 @@ TclAttemptCompileProc( /* * Advance parsePtr->tokenPtr so that it points at the last subcommand. - * This will be wrong, but it will not matter, and it will put the - * tokens for the arguments in the right place without the needed to - * allocate a synthetic Tcl_Parse struct, or copy tokens around. + * This will be wrong but it will not matter, and it will put the + * tokens for the arguments in the right place without the need to + * allocate a synthetic Tcl_Parse struct or copy tokens around. */ for (i = 0; i < depth - 1; i++) { @@ -3420,7 +3421,7 @@ CompileToInvokedCommand( * the implementation. */ - objPtr = Tcl_NewObj(); + TclNewObj(objPtr); Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr, objPtr); bytes = TclGetString(objPtr); if ((cmdPtr != NULL) && (cmdPtr->flags & CMD_VIA_RESOLVER)) { @@ -3459,8 +3460,9 @@ CompileBasicNArgCommand( * compiled. */ CompileEnv *envPtr) /* Holds resulting instructions. */ { - Tcl_Obj *objPtr = Tcl_NewObj(); + Tcl_Obj *objPtr; + TclNewObj(objPtr); Tcl_IncrRefCount(objPtr); Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr, objPtr); TclCompileInvocation(interp, parsePtr->tokenPtr, objPtr, |
