diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2004-07-07 22:05:56 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2004-07-07 22:05:56 (GMT) |
commit | adf2c077e4fdc5ed2becbcca261c4fc891bca5a9 (patch) | |
tree | a73df6dca3f608df7a084430cf236279ff176da1 /generic | |
parent | 80db59e20576cbaf4b35a47776c68b139b26e2f6 (diff) | |
download | tcl-adf2c077e4fdc5ed2becbcca261c4fc891bca5a9.zip tcl-adf2c077e4fdc5ed2becbcca261c4fc891bca5a9.tar.gz tcl-adf2c077e4fdc5ed2becbcca261c4fc891bca5a9.tar.bz2 |
* generic/tclCompile.c (TclCompileScript): fix for [Bug 458361].
Single-word scripts are compiled with an unshared cmdName to avoid
shimmering between bytecode and cmdName reps.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclCompile.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 92d3368..225b9cd 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCompile.c,v 1.68 2004/07/06 21:08:36 dgp Exp $ + * RCS: @(#) $Id: tclCompile.c,v 1.69 2004/07/07 22:05:59 msofer Exp $ */ #include "tclInt.h" @@ -1118,6 +1118,15 @@ TclCompileScript(interp, script, numBytes, envPtr) envPtr->literalArrayPtr[objIndex].objPtr, cmdPtr); } + if ((wordIdx == 0) && (parse.numWords == 1)) { + /* + * Single word script: unshare the command name to + * avoid shimmering between bytecode and cmdName + * representations [Bug 458361] + */ + + TclHideLiteral(interp, envPtr, objIndex); + } } else { objIndex = TclRegisterNewLiteral(envPtr, tokenPtr[1].start, tokenPtr[1].size); |