summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2010-10-20 13:34:09 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2010-10-20 13:34:09 (GMT)
commitaf0efce59e0440d75633b2dac8ab9ecd39806a30 (patch)
treee6696e5723dc7f6b5911fdaaec323e228b564d7a /generic/tclExecute.c
parent278b4c9ebf643183f815790c3c646b71937f8268 (diff)
downloadtcl-af0efce59e0440d75633b2dac8ab9ecd39806a30.zip
tcl-af0efce59e0440d75633b2dac8ab9ecd39806a30.tar.gz
tcl-af0efce59e0440d75633b2dac8ab9ecd39806a30.tar.bz2
* generic/tclCompCmds.c (TclCompileDictForCmd): Update the compilation
* generic/tclCompile.c (tclInstructionTable): of [dict for] so that * generic/tclExecute.c (TEBCresume): it no longer makes any use of INST_DICT_DONE now that's not needed, and make it clearer in the implementation of the instruction that it's just a deprecated form of unset operation. Followup to my commit of 2010-10-16.
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c43
1 files changed, 24 insertions, 19 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 65e0b22..5343ecd 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclExecute.c,v 1.507 2010/10/16 20:27:39 dkf Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.508 2010/10/20 13:34:11 dkf Exp $
*/
#include "tclInt.h"
@@ -3772,6 +3772,29 @@ TEBCresume(
CACHE_STACK_INFO();
TRACE_APPEND(("ERROR: %.30s\n", O2S(Tcl_GetObjResult(interp))));
goto gotError;
+
+ /*
+ * This is really an unset operation these days. Do not issue.
+ */
+
+ case INST_DICT_DONE:
+ opnd = TclGetUInt4AtPtr(pc+1);
+ TRACE(("%u\n", opnd));
+ varPtr = LOCAL(opnd);
+ while (TclIsVarLink(varPtr)) {
+ varPtr = varPtr->value.linkPtr;
+ }
+ if (TclIsVarDirectUnsettable(varPtr) && !TclIsVarInHash(varPtr)) {
+ if (!TclIsVarUndefined(varPtr)) {
+ TclDecrRefCount(varPtr->value.objPtr);
+ }
+ varPtr->value.objPtr = NULL;
+ } else {
+ DECACHE_STACK_INFO();
+ TclPtrUnsetVar(interp, varPtr, NULL, NULL, NULL, 0, opnd);
+ CACHE_STACK_INFO();
+ }
+ NEXT_INST_F(5, 0, 0);
}
/*
@@ -5972,24 +5995,6 @@ TEBCresume(
/* TODO: consider opt like INST_FOREACH_STEP4 */
NEXT_INST_F(5, 0, 1);
- case INST_DICT_DONE:
- opnd = TclGetUInt4AtPtr(pc+1);
- TRACE(("%u => ", opnd));
- statePtr = (*LOCAL(opnd)).value.objPtr;
-
- if (statePtr != NULL && statePtr->typePtr == &dictIteratorType) {
- /*
- * Set the internal variable to an empty object to signify that we
- * don't hold an iterator.
- */
-
- TclDecrRefCount(statePtr);
- TclNewObj(emptyPtr);
- (*LOCAL(opnd)).value.objPtr = emptyPtr;
- Tcl_IncrRefCount(emptyPtr);
- }
- NEXT_INST_F(5, 0, 0);
-
case INST_DICT_UPDATE_START:
opnd = TclGetUInt4AtPtr(pc+1);
opnd2 = TclGetUInt4AtPtr(pc+5);