From 761df1dd737fda3e0bda124509e81dd92ff72e84 Mon Sep 17 00:00:00 2001 From: Miguel Sofer Date: Sun, 16 May 2004 20:23:00 +0000 Subject: * generic/tclBasic.c (Tcl_DeleteInterp): * generic/tclExecute.c (INST_START_CMD): interp deletion now modifies the compileEpoch, eliminating the need for the check for interp deletion in INST_START_CMD. --- ChangeLog | 9 ++++++++- generic/tclBasic.c | 5 ++++- generic/tclExecute.c | 11 ++++++++--- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 47c4e11..729a0ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2004-05-16 Miguel Sofer + * generic/tclBasic.c (Tcl_DeleteInterp): + * generic/tclExecute.c (INST_START_CMD): interp deletion now + modifies the compileEpoch, eliminating the need for the check for + interp deletion in INST_START_CMD. + +2004-05-16 Miguel Sofer + * generic/tclCompile.h: * generic/tclCompile.c: * generic/tclExecute.c: changed implementation of {expand}, last @@ -45,7 +52,7 @@ 2004-05-14 Miguel Sofer - * generic/tclExecute.h: + * generic/tclExecute.c: * generic/tclCompile.h: the math functions receive a pointer to top of the stack (tosPtr) instead of the execution environment (eePtr). First step towards a change in the execution stack diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 71f377d..3054f98 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.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: tclBasic.c,v 1.100 2004/05/13 12:59:21 dkf Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.101 2004/05/16 20:23:01 msofer Exp $ */ #include "tclInt.h" @@ -918,9 +918,12 @@ Tcl_DeleteInterp(interp) /* * Mark the interpreter as deleted. No further evals will be allowed. + * Increase the compileEpoch as a signal to compiled bytecodes. */ iPtr->flags |= DELETED; + iPtr->compileEpoch++; + /* * Ensure that the interpreter is eventually deleted. diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 6c29150..41e155e 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.128 2004/05/16 17:25:49 msofer Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.129 2004/05/16 20:23:01 msofer Exp $ */ #include "tclInt.h" @@ -1336,8 +1336,13 @@ TclExecuteByteCode(interp, codePtr) } case INST_START_CMD: - if ((!(iPtr->flags & DELETED) - && (codeCompileEpoch == iPtr->compileEpoch) + /* + * Remark that if the interpreter is marked for deletion + * its compileEpoch is modified, so that the epoch + * check also verifies that the interp is not deleted. + */ + + if (((codeCompileEpoch == iPtr->compileEpoch) && (codeNsEpoch == namespacePtr->resolverEpoch)) || codePrecompiled) { NEXT_INST_F(5, 0, 0); -- cgit v0.12