diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | generic/tclCompile.c | 11 |
2 files changed, 16 insertions, 1 deletions
@@ -1,3 +1,9 @@ +2004-07-07 Miguel Sofer <msofer@users.sf.net> + + * 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. + 2004-07-07 Don Porter <dgp@users.sourceforge.net> * generic.tclCmdMZ.c (TclMergeReturnOptions): Simplified logic and 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); |