diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-02-19 10:34:31 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-02-19 10:34:31 (GMT) |
commit | a2fa2a169f18995949a89c1ff0de30dce5d69cff (patch) | |
tree | d9b723448fa129576c7c0f10cf38f54211381ab6 /generic/tclTrace.c | |
parent | 24e58b6dcd4b44327247cc7597c1ab1e08df023c (diff) | |
parent | 54ab86e08cf1c4b8cac8864c56c4bf48435fa0b9 (diff) | |
download | tcl-a2fa2a169f18995949a89c1ff0de30dce5d69cff.zip tcl-a2fa2a169f18995949a89c1ff0de30dce5d69cff.tar.gz tcl-a2fa2a169f18995949a89c1ff0de30dce5d69cff.tar.bz2 |
Fix bug #2438181: Incorrect error reporting in traces.
Test-case and fix provided by Poor Yorick.
Diffstat (limited to 'generic/tclTrace.c')
-rw-r--r-- | generic/tclTrace.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/generic/tclTrace.c b/generic/tclTrace.c index fa29160..fd7566d 100644 --- a/generic/tclTrace.c +++ b/generic/tclTrace.c @@ -1481,7 +1481,11 @@ TclCheckExecutionTraces( } iPtr->activeCmdTracePtr = active.nextPtr; if (state) { - (void) Tcl_RestoreInterpState(interp, state); + if (traceCode == TCL_OK) { + traceCode = Tcl_RestoreInterpState(interp, state); + } else { + Tcl_DiscardInterpState(state); + } } return(traceCode); @@ -1628,7 +1632,7 @@ TclCheckInterpTraces( iPtr->activeInterpTracePtr = active.nextPtr; if (state) { if (traceCode == TCL_OK) { - (void) Tcl_RestoreInterpState(interp, state); + traceCode = Tcl_RestoreInterpState(interp, state); } else { Tcl_DiscardInterpState(state); } @@ -2722,7 +2726,7 @@ TclCallVarTraces( iPtr->flags &= ~(ERR_ALREADY_LOGGED); Tcl_DiscardInterpState(state); } else { - (void) Tcl_RestoreInterpState((Tcl_Interp *)iPtr, state); + code = Tcl_RestoreInterpState((Tcl_Interp *)iPtr, state); } DisposeTraceResult(disposeFlags,result); } else if (state) { |