summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2004-07-11 21:56:01 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2004-07-11 21:56:01 (GMT)
commitdbcc758ef4555aa231333df80d7d865f6131b6d3 (patch)
treee1b14deb80623480a61732603d44be1111832c20 /generic/tclExecute.c
parentdc6fcf7106c018c43f10c407b3bc1a8571fdf1f6 (diff)
downloadtcl-dbcc758ef4555aa231333df80d7d865f6131b6d3.zip
tcl-dbcc758ef4555aa231333df80d7d865f6131b6d3.tar.gz
tcl-dbcc758ef4555aa231333df80d7d865f6131b6d3.tar.bz2
* generic/tclExecute.c (TEBC): fixed leak of expandNestList objs
when there is an error while an expansion is in progress (code added at checkForCatch).
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 46dab96..efbea33 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.144 2004/07/03 21:36:33 msofer Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.145 2004/07/11 21:56:01 msofer Exp $
*/
#ifdef STDC_HEADERS
@@ -4781,6 +4781,20 @@ TclExecuteByteCode(interp, codePtr)
iPtr->flags |= ERR_ALREADY_LOGGED;
}
}
+
+ /*
+ * Clear all expansions that may have started after the last
+ * INST_BEGIN_CATCH.
+ */
+
+ while ((expandNestList != NULL) && ((catchTop == initCatchTop) ||
+ ((ptrdiff_t) eePtr->stackPtr[catchTop] <=
+ (ptrdiff_t) expandNestList->internalRep.twoPtrValue.ptr1))) {
+ Tcl_Obj *objPtr = expandNestList->internalRep.twoPtrValue.ptr2;
+ TclDecrRefCount(expandNestList);
+ expandNestList = objPtr;
+ }
+
/*
* We must not catch an exceeded limit. Instead, it blows
* outwards until we either hit another interpreter (presumably