summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2005-10-22 01:35:26 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2005-10-22 01:35:26 (GMT)
commit780cc5981704cb13704126d1ac5835a2e58a0a1d (patch)
tree31b1f3d80a31faefe0af66f787bf45d30ba22342
parent66aeef87da87d50a82fb8bf2675d1b08e7260795 (diff)
downloadtcl-780cc5981704cb13704126d1ac5835a2e58a0a1d.zip
tcl-780cc5981704cb13704126d1ac5835a2e58a0a1d.tar.gz
tcl-780cc5981704cb13704126d1ac5835a2e58a0a1d.tar.bz2
* generic/tclExecute.c (INST_INCR_*): fixed [Bug 1334570]. Obj
leak detection and patch by Eric Melbardis.
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclExecute.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 12dd08a..56c255d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-10-22 Miguel Sofer <msofer@users.sf.net>
+
+ * generic/tclExecute.c (INST_INCR_*): fixed [Bug 1334570]. Obj
+ leak detection and patch by Eric Melbardis.
+
2005-10-21 Kevin B. Kenny <kennykb@acm.org>
* generic/tclStrToD.c (RefineApproximation): Plugged a memory leak
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 0287068..d77e51e 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -12,7 +12,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.217 2005/10/19 18:39:58 dgp Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.218 2005/10/22 01:35:26 msofer Exp $
*/
#include "tclInt.h"
@@ -2382,10 +2382,10 @@ TclExecuteByteCode(interp, codePtr)
case INST_INCR_STK_IMM:
i = TclGetInt1AtPtr(pc+1);
incrPtr = Tcl_NewIntObj(i);
+ Tcl_IncrRefCount(incrPtr);
pcAdjustment = 2;
doIncrStk:
- Tcl_IncrRefCount(incrPtr);
if ((*pc == INST_INCR_ARRAY_STK_IMM)
|| (*pc == INST_INCR_ARRAY_STK)) {
part2 = TclGetString(*tosPtr);
@@ -2416,10 +2416,10 @@ TclExecuteByteCode(interp, codePtr)
opnd = TclGetUInt1AtPtr(pc+1);
i = TclGetInt1AtPtr(pc+2);
incrPtr = Tcl_NewIntObj(i);
+ Tcl_IncrRefCount(incrPtr);
pcAdjustment = 3;
doIncrArray:
- Tcl_IncrRefCount(incrPtr);
part2 = TclGetString(*tosPtr);
arrayPtr = &(compiledLocals[opnd]);
part1 = arrayPtr->name;
@@ -2540,9 +2540,9 @@ TclExecuteByteCode(interp, codePtr)
}
/* All other cases, flow through to generic handling */
TclNewLongObj(incrPtr, i);
+ Tcl_IncrRefCount(incrPtr);
doIncrScalar:
- Tcl_IncrRefCount(incrPtr);
varPtr = &(compiledLocals[opnd]);
part1 = varPtr->name;
while (TclIsVarLink(varPtr)) {