summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmds.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-12-09 20:29:09 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-12-09 20:29:09 (GMT)
commit79a19a1fcbb36bd0b0e41da53fda3ee8be77efc9 (patch)
treeb3b254bfcfebf31f5c21ebb4f60bf88c890db32c /generic/tclCompCmds.c
parentd86c0849b3c0ed313c45e7fb28c62df8577fb690 (diff)
downloadtcl-79a19a1fcbb36bd0b0e41da53fda3ee8be77efc9.zip
tcl-79a19a1fcbb36bd0b0e41da53fda3ee8be77efc9.tar.gz
tcl-79a19a1fcbb36bd0b0e41da53fda3ee8be77efc9.tar.bz2
[e711ffb458] Replace TclIsLocalScalar() (which does the wrong thing).... with
PushVarNameWord() (which doesn't) in the compiler for [dict lappend].
Diffstat (limited to 'generic/tclCompCmds.c')
-rw-r--r--generic/tclCompCmds.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index c8ca828..7ecdc9b 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -1284,32 +1284,26 @@ TclCompileDictLappendCmd(
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
- Proc *procPtr = envPtr->procPtr;
- DefineLineInformation; /* TIP #280 */
Tcl_Token *varTokenPtr, *keyTokenPtr, *valueTokenPtr;
- int dictVarIndex, nameChars;
- const char *name;
+ int isSimple, dictVarIndex = -1, isScalar = 0;
+ DefineLineInformation; /* TIP #280 */
/*
* There must be three arguments after the command.
*/
- if (parsePtr->numWords != 4 || procPtr == NULL) {
+ if (parsePtr->numWords != 4) {
return TCL_ERROR;
}
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
keyTokenPtr = TokenAfter(varTokenPtr);
valueTokenPtr = TokenAfter(keyTokenPtr);
- if (varTokenPtr->type != TCL_TOKEN_SIMPLE_WORD) {
- return TCL_ERROR;
- }
- name = varTokenPtr[1].start;
- nameChars = varTokenPtr[1].size;
- if (!TclIsLocalScalar(name, nameChars)) {
+ PushVarNameWord(interp, varTokenPtr, envPtr, TCL_CREATE_VAR,
+ &dictVarIndex, &isSimple, &isScalar, 1);
+ if (!isScalar || dictVarIndex < 0) {
return TCL_ERROR;
}
- dictVarIndex = TclFindCompiledLocal(name, nameChars, 1, procPtr);
CompileWord(envPtr, keyTokenPtr, interp, 2);
CompileWord(envPtr, valueTokenPtr, interp, 3);
TclEmitInstInt4( INST_DICT_LAPPEND, dictVarIndex, envPtr);