summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-02-19 10:34:31 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-02-19 10:34:31 (GMT)
commit7ba8e6119017551866f531be022705ef17a1ed39 (patch)
treed9b723448fa129576c7c0f10cf38f54211381ab6 /generic
parentd14317916c9328450a7afd6cfa2168a6c5a7224f (diff)
parentee8be54ede03c2d1f37f4639dcff5b9a94722992 (diff)
downloadtcl-7ba8e6119017551866f531be022705ef17a1ed39.zip
tcl-7ba8e6119017551866f531be022705ef17a1ed39.tar.gz
tcl-7ba8e6119017551866f531be022705ef17a1ed39.tar.bz2
Fix bug #2438181: Incorrect error reporting in traces.
Test-case and fix provided by Poor Yorick.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclTrace.c10
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) {