summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2008-06-08 03:21:30 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2008-06-08 03:21:30 (GMT)
commit4819a5befc336eb974ac83e7b8cd60cb3b4b695b (patch)
tree1da367949238bc7267a07508a4cd8bcafdf80ebb /generic/tclExecute.c
parent17aeda99fb77f6fa2cd10e1dbc86bc85e57fe242 (diff)
downloadtcl-4819a5befc336eb974ac83e7b8cd60cb3b4b695b.zip
tcl-4819a5befc336eb974ac83e7b8cd60cb3b4b695b.tar.gz
tcl-4819a5befc336eb974ac83e7b8cd60cb3b4b695b.tar.bz2
* generic/tclBasic.c: Compilation of uplevel scripts, allow
* generic/tclCompCmds.c: non-body compiled scripts to access the * generic/tclCompile.c: LVT (but not to extend it) and enable the * generic/tclCompile.h: canonical list opt to sidestep the * generic/tclExecute.c: compiler. This is [Patch 1973096] * generic/tclProc.c: * tests/uplevel.test:
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 89c2066..5bbc366 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -13,7 +13,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.371 2008/04/27 22:21:30 dkf Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.372 2008/06/08 03:21:33 msofer Exp $
*/
#include "tclInt.h"
@@ -1463,7 +1463,18 @@ TclCompEvalObj(
}
}
- /*
+ if (codePtr->procPtr == NULL) {
+ /*
+ * Check that any compiled locals do refer to the current proc
+ * environment! If not, recompile.
+ */
+
+ if (codePtr->localCachePtr != iPtr->varFramePtr->localCachePtr) {
+ goto recompileObj;
+ }
+ }
+
+ /*
* Increment the code's ref count while it is being executed. If
* afterwards no references to it remain, free the code.
*/
@@ -1493,7 +1504,11 @@ TclCompEvalObj(
tclByteCodeType.setFromAnyProc(interp, objPtr);
iPtr->invokeCmdFramePtr = NULL;
codePtr = (ByteCode *) objPtr->internalRep.otherValuePtr;
- goto runCompiledObj;
+ if (iPtr->varFramePtr->localCachePtr) {
+ codePtr->localCachePtr = iPtr->varFramePtr->localCachePtr;
+ codePtr->localCachePtr->refCount++;
+ }
+ goto runCompiledObj;
done:
iPtr->numLevels--;