summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authormig <mig>2013-06-03 16:10:30 (GMT)
committermig <mig>2013-06-03 16:10:30 (GMT)
commit312d727024ac9e43d8989d411361cb1d0b50b9b5 (patch)
tree171f6909641b121b6ba73916d01dc834d4a6141d /generic/tclExecute.c
parentcd0b45e3e49b8571a05590350a80980f3cc2e1b3 (diff)
downloadtcl-312d727024ac9e43d8989d411361cb1d0b50b9b5.zip
tcl-312d727024ac9e43d8989d411361cb1d0b50b9b5.tar.gz
tcl-312d727024ac9e43d8989d411361cb1d0b50b9b5.tar.bz2
fix for perf bug detected by Kieran (https://groups.google.com/forum/?fromgroups#!topic/comp.lang.tcl/vfpI3bc-DkQ)
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 0de8e3c..8fb8e63 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -2424,11 +2424,6 @@ TclExecuteByteCode(
if (result == TCL_OK) {
Tcl_Obj *objPtr;
-#ifndef TCL_COMPILE_DEBUG
- if (*(pc+pcAdjustment) == INST_POP) {
- NEXT_INST_V((pcAdjustment+1), objc, 0);
- }
-#endif
/*
* Push the call's object result and continue execution with
* the next instruction.
@@ -2455,6 +2450,12 @@ TclExecuteByteCode(
TclNewObj(objPtr);
Tcl_IncrRefCount(objPtr);
iPtr->objResultPtr = objPtr;
+#ifndef TCL_COMPILE_DEBUG
+ if (*(pc+pcAdjustment) == INST_POP) {
+ TclDecrRefCount(objResultPtr);
+ NEXT_INST_V((pcAdjustment+1), objc, 0);
+ }
+#endif
NEXT_INST_V(pcAdjustment, objc, -1);
} else {
cleanup = objc;