diff options
author | dgp <dgp@users.sourceforge.net> | 2014-10-02 21:40:13 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-10-02 21:40:13 (GMT) |
commit | 3b4cf982e3722b4e97880437e65db834841c8754 (patch) | |
tree | 2a0f814d261f0fb221dda504b024bb0214c7e72e /generic | |
parent | 7c4da917a70dbd0998ae98d1595fe01df87d646e (diff) | |
download | tcl-3b4cf982e3722b4e97880437e65db834841c8754.zip tcl-3b4cf982e3722b4e97880437e65db834841c8754.tar.gz tcl-3b4cf982e3722b4e97880437e65db834841c8754.tar.bz2 |
Possible fix for testing.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclCompCmds.c | 8 | ||||
-rw-r--r-- | generic/tclTrace.c | 7 |
2 files changed, 8 insertions, 7 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 496d44f..18f4564 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -301,7 +301,8 @@ TclCompileArraySetCmd( * a proc, we cannot do a better compile than generic. */ - if (envPtr->procPtr == NULL && !(isDataEven && len == 0)) { + if ((varTokenPtr->type != TCL_TOKEN_SIMPLE_WORD) || + (envPtr->procPtr == NULL && !(isDataEven && len == 0))) { code = TclCompileBasic2ArgCmd(interp, parsePtr, cmdPtr, envPtr); goto done; } @@ -342,8 +343,9 @@ TclCompileArraySetCmd( * a non-local variable: upvar from a local one! This consumes the * variable name that was left at stacktop. */ - - localIndex = AnonymousLocal(envPtr); + + localIndex = TclFindCompiledLocal(varTokenPtr->start, + varTokenPtr->size, 1, envPtr); PushStringLiteral(envPtr, "0"); TclEmitInstInt4(INST_REVERSE, 2, envPtr); TclEmitInstInt4(INST_UPVAR, localIndex, envPtr); diff --git a/generic/tclTrace.c b/generic/tclTrace.c index 2a348e6..6184a89 100644 --- a/generic/tclTrace.c +++ b/generic/tclTrace.c @@ -2511,11 +2511,10 @@ TclObjCallVarTraces( if (!part1Ptr) { part1Ptr = localName(iPtr->varFramePtr, index); } - if (part1Ptr) { - part1 = TclGetString(part1Ptr); - } else { - part1 = tclEmptyString; + if (!part1Ptr) { + Tcl_Panic("Cannot trace a variable with no name"); } + part1 = TclGetString(part1Ptr); part2 = part2Ptr? TclGetString(part2Ptr) : NULL; return TclCallVarTraces(iPtr, arrayPtr, varPtr, part1, part2, flags, |