diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2004-07-11 21:56:01 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2004-07-11 21:56:01 (GMT) |
commit | dbcc758ef4555aa231333df80d7d865f6131b6d3 (patch) | |
tree | e1b14deb80623480a61732603d44be1111832c20 | |
parent | dc6fcf7106c018c43f10c407b3bc1a8571fdf1f6 (diff) | |
download | tcl-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).
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | generic/tclExecute.c | 16 |
2 files changed, 21 insertions, 1 deletions
@@ -1,3 +1,9 @@ +2004-07-11 Miguel Sofer <msofer@users.sf.net> + + * generic/tclExecute.c (TEBC): fixed leak of expandNestList objs + when there is an error while an expansion is in progress (code + added at checkForCatch). + 2004-07-11 Vince Darley <vincentdarley@users.sourceforge.net> * generic/tclIOUtil.c: fix to 'cd' bug when vfs is active 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 |