summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormig <mig>2013-06-03 16:52:48 (GMT)
committermig <mig>2013-06-03 16:52:48 (GMT)
commitbcc20b58f79b107e5877ba74855fd4f5b6f567df (patch)
tree0538ed9c955879fe921c239527c88bfab0677094
parentf164a024d685eded1136cd790f655acfea3ace93 (diff)
parent312d727024ac9e43d8989d411361cb1d0b50b9b5 (diff)
downloadtcl-bcc20b58f79b107e5877ba74855fd4f5b6f567df.zip
tcl-bcc20b58f79b107e5877ba74855fd4f5b6f567df.tar.gz
tcl-bcc20b58f79b107e5877ba74855fd4f5b6f567df.tar.bz2
fix for perf bug detected by Kieran (https://groups.google.com/forum/?fromgroups#!topic/comp.lang.tcl/vfpI3bc-DkQ)
-rw-r--r--ChangeLog8
-rw-r--r--generic/tclExecute.c14
2 files changed, 15 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 30d0f0d..f2a8c44 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013-06-03 Miguel Sofer <msofer@users.sf.net>
+
+ * generic/tclExecute.c: fix for perf bug detected by Kieran
+ (https://groups.google.com/forum/?fromgroups#!topic/comp.lang.tcl/vfpI3bc-DkQ),
+ diagnosed by dgp to be a close relative of [Bug 781585], which was
+ fixed by commit [f46fb50cb3]. This bug was introduced by myself in
+ commit [cbfe055d8c].
+
2013-06-03 Donal K. Fellows <dkf@users.sf.net>
* generic/tclCompCmds.c (TclCompileBreakCmd, TclCompileContinueCmd):
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 7c645e7..8c87364 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);
}