summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2013-06-05 07:57:06 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2013-06-05 07:57:06 (GMT)
commit984c4923d6abb322e755dcde5b14bc19747eb8b8 (patch)
tree81285a3f1d78895d9f807681638a409ea60f0440 /generic/tclExecute.c
parent4d139bcdd3359f4e4d35db3d5fce67c6b528532c (diff)
parent6f640f9e5701a60ac0fbde981742fd3a80f59d18 (diff)
downloadtcl-984c4923d6abb322e755dcde5b14bc19747eb8b8.zip
tcl-984c4923d6abb322e755dcde5b14bc19747eb8b8.tar.gz
tcl-984c4923d6abb322e755dcde5b14bc19747eb8b8.tar.bz2
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index fc50a74..98ce51e 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -2142,11 +2142,6 @@ TEBCresume(
CACHE_STACK_INFO();
if (result == TCL_OK) {
-#ifndef TCL_COMPILE_DEBUG
- if (*pc == INST_POP) {
- NEXT_INST_V(1, cleanup, 0);
- }
-#endif
/*
* Push the call's object result and continue execution with the
* next instruction.
@@ -2155,8 +2150,6 @@ TEBCresume(
TRACE_WITH_OBJ(("%u => ... after \"%.20s\": TCL_OK, result=",
objc, cmdNameBuf), Tcl_GetObjResult(interp));
- objResultPtr = Tcl_GetObjResult(interp);
-
/*
* Reset the interp's result to avoid possible duplications of
* large objects [Bug 781585]. We do not call Tcl_ResetResult to
@@ -2168,9 +2161,16 @@ TEBCresume(
* the refCount it had in its role of iPtr->objResultPtr.
*/
+ objResultPtr = Tcl_GetObjResult(interp);
TclNewObj(objPtr);
Tcl_IncrRefCount(objPtr);
iPtr->objResultPtr = objPtr;
+#ifndef TCL_COMPILE_DEBUG
+ if (*pc == INST_POP) {
+ TclDecrRefCount(objResultPtr);
+ NEXT_INST_V(1, cleanup, 0);
+ }
+#endif
NEXT_INST_V(0, cleanup, -1);
}