diff options
author | hobbs <hobbs@noemail.net> | 2001-07-03 23:39:09 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2001-07-03 23:39:09 (GMT) |
commit | 0eb4c2284279bf6db514d3bee8b105dd12f72473 (patch) | |
tree | 01f5d0e976d85cb8ca8d7d711ad2e8887c54a433 /generic | |
parent | cd0e93e07727f16fe1c2a16a5d5354997b4bf969 (diff) | |
download | tcl-0eb4c2284279bf6db514d3bee8b105dd12f72473.zip tcl-0eb4c2284279bf6db514d3bee8b105dd12f72473.tar.gz tcl-0eb4c2284279bf6db514d3bee8b105dd12f72473.tar.bz2 |
* generic/tclExecute.c (TclExecuteByteCode): added TCL_TRACE_READS
flag to INST_LAPPEND(_ARRAY)_STK case to trigger read traces for
newly created arrays. Removed unnecessary #ifdef for
TCL_COMPILE_DEBUG in INST_LOAD_SCALAR1 case.
FossilOrigin-Name: 6a80a5463bd1b0b08690906f366949fe9a31c028
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclExecute.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 3183ef2..bf98c8d 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -10,7 +10,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.25 2001/05/31 12:58:09 dkf Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.26 2001/07/03 23:39:10 hobbs Exp $ */ #include "tclInt.h" @@ -1094,7 +1094,6 @@ TclExecuteByteCode(interp, codePtr) ADJUST_PC(1); case INST_LOAD_SCALAR1: -#ifdef TCL_COMPILE_DEBUG opnd = TclGetUInt1AtPtr(pc+1); DECACHE_STACK_INFO(); valuePtr = TclGetIndexedScalar(interp, opnd, TCL_LEAVE_ERR_MSG); @@ -1107,17 +1106,6 @@ TclExecuteByteCode(interp, codePtr) } PUSH_OBJECT(valuePtr); TRACE_WITH_OBJ(("%u => ", opnd), valuePtr); -#else /* TCL_COMPILE_DEBUG */ - DECACHE_STACK_INFO(); - opnd = TclGetUInt1AtPtr(pc+1); - valuePtr = TclGetIndexedScalar(interp, opnd, TCL_LEAVE_ERR_MSG); - CACHE_STACK_INFO(); - if (valuePtr == NULL) { - result = TCL_ERROR; - goto checkForCatch; - } - PUSH_OBJECT(valuePtr); -#endif /* TCL_COMPILE_DEBUG */ ADJUST_PC(2); case INST_LOAD_SCALAR4: @@ -1478,8 +1466,14 @@ TclExecuteByteCode(interp, codePtr) objPtr = POP_OBJECT(); /* scalar name */ DECACHE_STACK_INFO(); - /* Currently value of the list */ - valuePtr = Tcl_ObjGetVar2(interp, objPtr, elemPtr, 0); + /* + * Currently value of the list. + * Use the TCL_TRACE_READS flag to ensure that if we have an + * array with no elements set yet, but with a read trace on it, + * we will create the variable and get read traces triggered. + */ + valuePtr = Tcl_ObjGetVar2(interp, objPtr, elemPtr, + TCL_TRACE_READS); CACHE_STACK_INFO(); if (valuePtr == NULL) { valuePtr = Tcl_NewObj(); |