summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2001-07-03 23:39:10 (GMT)
committerhobbs <hobbs>2001-07-03 23:39:10 (GMT)
commitb7c987b2bd964f508ecf3e92bbe4b3adeb5bba93 (patch)
tree01f5d0e976d85cb8ca8d7d711ad2e8887c54a433
parentee822c860d83e55c7061d5151541f4d8fd8c44e8 (diff)
downloadtcl-b7c987b2bd964f508ecf3e92bbe4b3adeb5bba93.zip
tcl-b7c987b2bd964f508ecf3e92bbe4b3adeb5bba93.tar.gz
tcl-b7c987b2bd964f508ecf3e92bbe4b3adeb5bba93.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.
-rw-r--r--generic/tclExecute.c24
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();