summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authormsofer <msofer@noemail.net>2002-02-28 13:03:53 (GMT)
committermsofer <msofer@noemail.net>2002-02-28 13:03:53 (GMT)
commit1fff4cd7649e215c241851ca4a406da026e40639 (patch)
treef0c650105b99b220ed75ce120c631bddd71b9075 /generic
parentaddc87417c54bb55b560b9afdf106e3ee0db660e (diff)
downloadtcl-1fff4cd7649e215c241851ca4a406da026e40639.zip
tcl-1fff4cd7649e215c241851ca4a406da026e40639.tar.gz
tcl-1fff4cd7649e215c241851ca4a406da026e40639.tar.bz2
Replaced a few direct stack accesses with the POP_OBJECT() macro [Bug 507181]
FossilOrigin-Name: 754d241a98f3e905d72ad5a8cac2064a36cd7385
Diffstat (limited to 'generic')
-rw-r--r--generic/tclExecute.c28
1 files changed, 13 insertions, 15 deletions
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.