summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2006-02-28 15:44:35 (GMT)
committerdgp <dgp@users.sourceforge.net>2006-02-28 15:44:35 (GMT)
commitaea6c6f98570eb34604011e06d7fc4d5b9cc256a (patch)
tree0b98b7f4840ce4ea0d3d4c45a12c943727b140a3 /generic
parent07a404f12e65c2c31b9f326556b7067abd8c9548 (diff)
downloadtcl-aea6c6f98570eb34604011e06d7fc4d5b9cc256a.zip
tcl-aea6c6f98570eb34604011e06d7fc4d5b9cc256a.tar.gz
tcl-aea6c6f98570eb34604011e06d7fc4d5b9cc256a.tar.bz2
* generic/tclBasic.c: Corrections to be sure that TCL_EVAL_GLOBAL
* tests/parse.test: evaluations act the same as [uplevel #0] * tests/trace.test: evaluations, even when execution traces or invocations of [::unknown] are present. [Bug 1439836].
Diffstat (limited to 'generic')
-rw-r--r--generic/tclBasic.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index b3474bb..f70af71 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.75.2.19 2005/11/18 23:07:26 msofer Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.75.2.20 2006/02/28 15:44:35 dgp Exp $
*/
#include "tclInt.h"
@@ -3034,7 +3034,8 @@ TclEvalObjvInternal(interp, objc, objv, command, length, flags)
code = TCL_ERROR;
} else {
iPtr->numLevels++;
- code = TclEvalObjvInternal(interp, objc+1, newObjv, command, length, 0);
+ code = TclEvalObjvInternal(interp, objc+1, newObjv,
+ command, length, flags);
iPtr->numLevels--;
}
Tcl_DecrRefCount(newObjv[0]);
@@ -3053,6 +3054,10 @@ TclEvalObjvInternal(interp, objc, objv, command, length, flags)
* any existing traces, then the set checkTraces to 0 and
* go through this while loop one more time.
*/
+ savedVarFramePtr = iPtr->varFramePtr;
+ if (flags & TCL_EVAL_GLOBAL) {
+ iPtr->varFramePtr = NULL;
+ }
if (iPtr->tracePtr != NULL && traceCode == TCL_OK) {
traceCode = TclCheckInterpTraces(interp, command, length,
cmdPtr, code, TCL_TRACE_ENTER_EXEC, objc, objv);
@@ -3062,6 +3067,7 @@ TclEvalObjvInternal(interp, objc, objv, command, length, flags)
traceCode = TclCheckExecutionTraces(interp, command, length,
cmdPtr, code, TCL_TRACE_ENTER_EXEC, objc, objv);
}
+ iPtr->varFramePtr = savedVarFramePtr;
cmdPtr->refCount--;
if (cmdEpoch != cmdPtr->cmdEpoch) {
/* The command has been modified in some way */
@@ -3095,6 +3101,10 @@ TclEvalObjvInternal(interp, objc, objv, command, length, flags)
if (!(cmdPtr->flags & CMD_IS_DELETED)) {
int saveErrFlags = iPtr->flags
& (ERR_IN_PROGRESS | ERR_ALREADY_LOGGED | ERROR_CODE_SET);
+ savedVarFramePtr = iPtr->varFramePtr;
+ if (flags & TCL_EVAL_GLOBAL) {
+ iPtr->varFramePtr = NULL;
+ }
if ((cmdPtr->flags & CMD_HAS_EXEC_TRACES) && (traceCode == TCL_OK)) {
traceCode = TclCheckExecutionTraces (interp, command, length,
cmdPtr, code, TCL_TRACE_LEAVE_EXEC, objc, objv);
@@ -3103,6 +3113,7 @@ TclEvalObjvInternal(interp, objc, objv, command, length, flags)
traceCode = TclCheckInterpTraces(interp, command, length,
cmdPtr, code, TCL_TRACE_LEAVE_EXEC, objc, objv);
}
+ iPtr->varFramePtr = savedVarFramePtr;
if (traceCode == TCL_OK) {
iPtr->flags |= saveErrFlags;
}