summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2002-02-28 13:03:53 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2002-02-28 13:03:53 (GMT)
commit3b911b1e99e8f3e7b310b2c3c2453d66ee1d2885 (patch)
treef0c650105b99b220ed75ce120c631bddd71b9075
parente74c02673aec97beeb6f8ae55376bd5b88d9e3cc (diff)
downloadtcl-3b911b1e99e8f3e7b310b2c3c2453d66ee1d2885.zip
tcl-3b911b1e99e8f3e7b310b2c3c2453d66ee1d2885.tar.gz
tcl-3b911b1e99e8f3e7b310b2c3c2453d66ee1d2885.tar.bz2
Replaced a few direct stack accesses with the POP_OBJECT() macro [Bug 507181]
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclExecute.c28
2 files changed, 18 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index c379368..7505cd2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-02-28 Miguel Sofer <msofer@users.sourceforge.net>
+
+ * generic/tclExecute.c: Replaced a few direct stack accesses
+ with the POP_OBJECT() macro [Bug 507181] (Don Porter).
+
2002-02-27 Don Porter <dgp@users.sourceforge.net>
* doc/GetIndex.3:
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 21eb610..1745650 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -11,7 +11,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.48 2002/02/15 19:58:28 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.49 2002/02/28 13:03:53 msofer Exp $
*/
#include "tclInt.h"
@@ -1371,9 +1371,8 @@ TclExecuteByteCode(interp, codePtr)
*/
for (i = 0; i < objc; i++) {
- valuePtr = stackPtr[stackTop];
+ valuePtr = POP_OBJECT();
TclDecrRefCount(valuePtr);
- stackTop--;
}
/*
@@ -1886,11 +1885,10 @@ TclExecuteByteCode(interp, codePtr)
opnd = TclGetUInt4AtPtr(pc+1);
valuePtr = Tcl_NewListObj(opnd, &(stackPtr[stackTop - (opnd-1)]));
-
- for (i = 0; i < opnd; stackTop--, i++) {
- TclDecrRefCount(stackPtr[stackTop]);
+ for (i = 0; i < opnd; i++) {
+ objPtr = POP_OBJECT();
+ TclDecrRefCount(objPtr);
}
-
PUSH_OBJECT(valuePtr);
TRACE_WITH_OBJ(("%u => ", opnd), valuePtr);
ADJUST_PC(5);
@@ -2609,7 +2607,8 @@ TclExecuteByteCode(interp, codePtr)
/*
* Watch out for multiple references in macros!
*/
- valuePtr = stackPtr[stackTop--];
+
+ valuePtr = POP_OBJECT();
TclDecrRefCount(valuePtr);
}
@@ -2670,7 +2669,8 @@ TclExecuteByteCode(interp, codePtr)
/*
* Watch out for multiple references in macros!
*/
- valuePtr = stackPtr[stackTop--];
+
+ valuePtr = POP_OBJECT();
TclDecrRefCount(valuePtr);
}
@@ -5822,14 +5822,12 @@ ExprCallMathFunc(interp, eePtr, objc, objv)
/*
* Pop the objc top stack elements and decrement their ref counts.
*/
-
- i = (stackTop - (objc-1));
- while (i <= stackTop) {
- valuePtr = stackPtr[i];
+
+ k = (stackTop - (objc-1));
+ while (stackTop >= k) {
+ valuePtr = POP_OBJECT();
TclDecrRefCount(valuePtr);
- i++;
}
- stackTop -= objc;
/*
* Push the call's object result.