summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2006-10-31 00:09:24 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2006-10-31 00:09:24 (GMT)
commit7bee3e28692d4f29cf020e91b07e698841861110 (patch)
tree6e59dc37ba4a23939321876f830e7b4282bb18ad /generic
parent1f4e15f7d1e456995a619f7540eca11f31d5f6ed (diff)
downloadtcl-7bee3e28692d4f29cf020e91b07e698841861110.zip
tcl-7bee3e28692d4f29cf020e91b07e698841861110.tar.gz
tcl-7bee3e28692d4f29cf020e91b07e698841861110.tar.bz2
* generic/tclBasic.c (TEOVI): insured that the interp's callObjc/v
fields are restored after traces run, as they be spoiled. This was causing a segfault in tcllib's profiler tests.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclBasic.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index b6abca2..d5f0e3d 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.204 2006/10/27 12:33:18 dkf Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.205 2006/10/31 00:09:25 msofer Exp $
*/
#include "tclInt.h"
@@ -3302,7 +3302,6 @@ TclEvalObjvInternal(
}
}
-
/*
* Record the calling objc/objv except if requested not to
*/
@@ -3402,16 +3401,27 @@ TclEvalObjvInternal(
if (iPtr->tracePtr != NULL && traceCode == TCL_OK) {
traceCode = TclCheckInterpTraces(interp, command, length,
cmdPtr, code, TCL_TRACE_ENTER_EXEC, objc, objv);
+ checkTraces = 0;
}
if ((cmdPtr->flags & CMD_HAS_EXEC_TRACES) && (traceCode == TCL_OK)) {
traceCode = TclCheckExecutionTraces(interp, command, length,
cmdPtr, code, TCL_TRACE_ENTER_EXEC, objc, objv);
+ checkTraces = 0;
}
cmdPtr->refCount--;
+
+ /*
+ * Restore the calling objc/objv, in case it was spoiled by traces
+ */
+
+ if (!(checktraces && (flags & TCL_EVAL_NOREWRITE)) {
+ iPtr->callObjc = objc;
+ iPtr->callObjv = objv;
+ }
+
}
if (cmdEpoch != cmdPtr->cmdEpoch) {
/* The command has been modified in some way. */
- checkTraces = 0;
goto reparseBecauseOfTraces;
}