From 7bee3e28692d4f29cf020e91b07e698841861110 Mon Sep 17 00:00:00 2001 From: Miguel Sofer Date: Tue, 31 Oct 2006 00:09:24 +0000 Subject: * 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. --- ChangeLog | 8 +++++++- generic/tclBasic.c | 16 +++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 24feb9b..30b1666 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,16 @@ +2006-10-30 Miguel Sofer + + * 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 * 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 +2006-10-29 Miguel Sofer * 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; } -- cgit v0.12