summaryrefslogtreecommitdiffstats
path: root/generic/tclCompile.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-08-27 15:12:38 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-08-27 15:12:38 (GMT)
commitd807bb087b7c5fdec280d68120900066bb8e05ae (patch)
tree705afa5dff7582b5ecb3c89460a5e5a99c490525 /generic/tclCompile.c
parentd679f070dcc31cea4f7fa392c47a081d7d926476 (diff)
downloadtcl-d807bb087b7c5fdec280d68120900066bb8e05ae.zip
tcl-d807bb087b7c5fdec280d68120900066bb8e05ae.tar.gz
tcl-d807bb087b7c5fdec280d68120900066bb8e05ae.tar.bz2
* generic/tclCompile.c: Move the deallocation of local LiteralTable
* generic/tclCompExpr.c: entries into TclFreeCompileEnv(). * generic/tclExecute.c: Update callers.
Diffstat (limited to 'generic/tclCompile.c')
-rw-r--r--generic/tclCompile.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index eaf8514..ab7d2ce 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.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: tclCompile.c,v 1.126 2007/08/24 11:22:51 msofer Exp $
+ * RCS: @(#) $Id: tclCompile.c,v 1.127 2007/08/27 15:12:38 dgp Exp $
*/
#include "tclInt.h"
@@ -463,7 +463,6 @@ TclSetByteCodeFromAny(
Interp *iPtr = (Interp *) interp;
CompileEnv compEnv; /* Compilation environment structure allocated
* in frame. */
- LiteralTable *localTablePtr = &(compEnv.localLitTable);
register AuxData *auxDataPtr;
LiteralEntry *entryPtr;
register int i;
@@ -545,13 +544,6 @@ TclSetByteCodeFromAny(
}
}
- /*
- * Free storage allocated during compilation.
- */
-
- if (localTablePtr->buckets != localTablePtr->staticBuckets) {
- ckfree((char *) localTablePtr->buckets);
- }
TclFreeCompileEnv(&compEnv);
return result;
}
@@ -989,6 +981,10 @@ void
TclFreeCompileEnv(
register CompileEnv *envPtr)/* Points to the CompileEnv structure. */
{
+ if (envPtr->localLitTable.buckets != envPtr->localLitTable.staticBuckets) {
+ ckfree((char *) envPtr->localLitTable.buckets);
+ envPtr->localLitTable.buckets = envPtr->localLitTable.staticBuckets;
+ }
if (envPtr->mallocedCodeArray) {
ckfree((char *) envPtr->codeStart);
}