summaryrefslogtreecommitdiffstats
path: root/generic/tclEnsemble.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-09-07 12:54:51 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-09-07 12:54:51 (GMT)
commitea21bb5de3ca09b64d101656f0613cd10f877aa6 (patch)
treec23482e15f548dd69d16c9749aeb85e3b4cd06d5 /generic/tclEnsemble.c
parent907e3ead5a3a2615c5721af947895bb4cacd3c99 (diff)
parent2a4281604ab70d1943a74f592e151c6a203f0bdd (diff)
downloadtcl-ea21bb5de3ca09b64d101656f0613cd10f877aa6.zip
tcl-ea21bb5de3ca09b64d101656f0613cd10f877aa6.tar.gz
tcl-ea21bb5de3ca09b64d101656f0613cd10f877aa6.tar.bz2
Fix [d4e7780ca1681cd095dbd81fe264feff75c988f7|d4e7780ca1]: "global" cmd literal sharing vs. per-interp resolvers
Diffstat (limited to 'generic/tclEnsemble.c')
-rw-r--r--generic/tclEnsemble.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c
index 8e5e410..6fedf29 100644
--- a/generic/tclEnsemble.c
+++ b/generic/tclEnsemble.c
@@ -3306,7 +3306,7 @@ CompileToInvokedCommand(
Tcl_Token *tokPtr;
Tcl_Obj *objPtr, **words;
char *bytes;
- int length, i, numWords, cmdLit;
+ int length, i, numWords, cmdLit, extraLiteralFlags = LITERAL_CMD_NAME;
DefineLineInformation;
/*
@@ -3349,7 +3349,10 @@ CompileToInvokedCommand(
objPtr = Tcl_NewObj();
Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr, objPtr);
bytes = Tcl_GetStringFromObj(objPtr, &length);
- cmdLit = TclRegisterNewCmdLiteral(envPtr, bytes, length);
+ if ((cmdPtr != NULL) && (cmdPtr->flags & CMD_VIA_RESOLVER)) {
+ extraLiteralFlags |= LITERAL_UNSHARED;
+ }
+ cmdLit = TclRegisterLiteral(envPtr, (char *)bytes, length, extraLiteralFlags);
TclSetCmdNameObj(interp, TclFetchLiteral(envPtr, cmdLit), cmdPtr);
TclEmitPush(cmdLit, envPtr);
TclDecrRefCount(objPtr);