summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-02-21 21:14:55 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-02-21 21:14:55 (GMT)
commit6bd81a4dac7ec52c342aeb40e59ff6ea2387669a (patch)
tree852cecdeef1aa1640ac54aaa1a5e1a7e2c25f5c5 /generic/tclExecute.c
parent7c09879dbba02a4c3b86b6fbc4b9f1a05dba7b5b (diff)
downloadtcl-6bd81a4dac7ec52c342aeb40e59ff6ea2387669a.zip
tcl-6bd81a4dac7ec52c342aeb40e59ff6ea2387669a.tar.gz
tcl-6bd81a4dac7ec52c342aeb40e59ff6ea2387669a.tar.bz2
Protect against multiple uses of a CompileEnv with only one initialization.
Make TclFreeCompileEnv smarter about cleanup so all callers do not have to be. Revise TclSetByteCodeFromAny() so that when hookProc raises an error, bytecode is not generated. This was rumored to cause crashes.
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index c09b73e..1ae182c 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -724,11 +724,9 @@ Tcl_ExprObj(interp, objPtr, resultPtrPtr)
register ByteCode *codePtr = NULL;
/* Tcl Internal type of bytecode.
* Initialized to avoid compiler warning. */
- AuxData *auxDataPtr;
- LiteralEntry *entryPtr;
Tcl_Obj *saveObjPtr;
char *string;
- int length, i, result;
+ int length, result;
/*
* First handle some common expressions specially.
@@ -808,22 +806,7 @@ Tcl_ExprObj(interp, objPtr, resultPtrPtr)
#ifdef TCL_COMPILE_DEBUG
TclVerifyLocalLiteralTable(&compEnv);
#endif /*TCL_COMPILE_DEBUG*/
- entryPtr = compEnv.literalArrayPtr;
- for (i = 0; i < compEnv.literalArrayNext; i++) {
- TclReleaseLiteral(interp, entryPtr->objPtr);
- entryPtr++;
- }
-#ifdef TCL_COMPILE_DEBUG
- TclVerifyGlobalLiteralTable(iPtr);
-#endif /*TCL_COMPILE_DEBUG*/
- auxDataPtr = compEnv.auxDataArrayPtr;
- for (i = 0; i < compEnv.auxDataArrayNext; i++) {
- if (auxDataPtr->type->freeProc != NULL) {
- auxDataPtr->type->freeProc(auxDataPtr->clientData);
- }
- auxDataPtr++;
- }
TclFreeCompileEnv(&compEnv);
goto done;
}