diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-09-02 12:11:01 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-09-02 12:11:01 (GMT) |
commit | 68caa10ca3562292a830860aaa37289795fe68b7 (patch) | |
tree | 7754802e4bd11708a3c967883846c3930f57ed4b /generic/tclCompile.c | |
parent | d84492f3906d20d05b547a4fa90286fe0a59bb37 (diff) | |
download | tcl-68caa10ca3562292a830860aaa37289795fe68b7.zip tcl-68caa10ca3562292a830860aaa37289795fe68b7.tar.gz tcl-68caa10ca3562292a830860aaa37289795fe68b7.tar.bz2 |
Proposed patch for [d4e7780ca1681cd095dbd81fe264feff75c988f7|d4e7780ca1], by Gustaf Neumann
Diffstat (limited to 'generic/tclCompile.c')
-rw-r--r-- | generic/tclCompile.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c index c0203dd..4e4ead6 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -1781,10 +1781,20 @@ CompileCmdLiteral( CompileEnv *envPtr) { int numBytes; - const char *bytes = Tcl_GetStringFromObj(cmdObj, &numBytes); - int cmdLitIdx = TclRegisterNewCmdLiteral(envPtr, bytes, numBytes); - Command *cmdPtr = (Command *) Tcl_GetCommandFromObj(interp, cmdObj); + const char *bytes; + Command *cmdPtr; + int cmdLitIdx, extraLiteralFlags = 0; + + cmdPtr = (Command *) Tcl_GetCommandFromObj(interp, cmdObj); + if (cmdPtr != NULL) { + if ((cmdPtr->flags & CMD_VIA_RESOLVER)) { + extraLiteralFlags = LITERAL_UNSHARED; + } + } + bytes = Tcl_GetStringFromObj(cmdObj, &numBytes); + cmdLitIdx = TclRegisterNewCmdLiteral(envPtr, bytes, numBytes, extraLiteralFlags); + if (cmdPtr) { TclSetCmdNameObj(interp, TclFetchLiteral(envPtr, cmdLitIdx), cmdPtr); } |