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 | 2bd794f7cc85201d24a257dff0b649c9dd1eb0a5 (patch) | |
| tree | 7754802e4bd11708a3c967883846c3930f57ed4b /generic/tclCompile.c | |
| parent | 3b2cb79ab18e9506dfb66e2786a7ee04dd30a780 (diff) | |
| download | tcl-2bd794f7cc85201d24a257dff0b649c9dd1eb0a5.zip tcl-2bd794f7cc85201d24a257dff0b649c9dd1eb0a5.tar.gz tcl-2bd794f7cc85201d24a257dff0b649c9dd1eb0a5.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); } |
