diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2002-02-28 13:03:53 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2002-02-28 13:03:53 (GMT) |
commit | 3b911b1e99e8f3e7b310b2c3c2453d66ee1d2885 (patch) | |
tree | f0c650105b99b220ed75ce120c631bddd71b9075 /generic/tclExecute.c | |
parent | e74c02673aec97beeb6f8ae55376bd5b88d9e3cc (diff) | |
download | tcl-3b911b1e99e8f3e7b310b2c3c2453d66ee1d2885.zip tcl-3b911b1e99e8f3e7b310b2c3c2453d66ee1d2885.tar.gz tcl-3b911b1e99e8f3e7b310b2c3c2453d66ee1d2885.tar.bz2 |
Replaced a few direct stack accesses with the POP_OBJECT() macro [Bug 507181]
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r-- | generic/tclExecute.c | 28 |
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. |