diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2006-10-31 00:09:24 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2006-10-31 00:09:24 (GMT) |
commit | 7bee3e28692d4f29cf020e91b07e698841861110 (patch) | |
tree | 6e59dc37ba4a23939321876f830e7b4282bb18ad | |
parent | 1f4e15f7d1e456995a619f7540eca11f31d5f6ed (diff) | |
download | tcl-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.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | generic/tclBasic.c | 16 |
2 files changed, 20 insertions, 4 deletions
@@ -1,10 +1,16 @@ +2006-10-30 Miguel Sofer <msofer@users.sf.net> + + * 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. + 2006-10-30 Don Porter <dgp@users.sourceforge.net> * generic/tclExecute.c (INST_MOD): Corrected improper testing of * tests/expr.test: the sign of bignums when applying Tcl's division rules. Thanks to Peter Spjuth. [Bug 1585704] -2006-10-26 Miguel Sofer <msofer@users.sf.net> +2006-10-29 Miguel Sofer <msofer@users.sf.net> * generic/tclNamesp.c (EnsembleImplementationCmd): * tests/namespace.test (47.7-8): reverted a wrong "optimisation" that 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; } |