summaryrefslogtreecommitdiffstats
path: root/generic/tclTrace.c
diff options
context:
space:
mode:
authornijtmans@users.sourceforge.net <jan.nijtmans>2013-02-19 11:36:12 (GMT)
committernijtmans@users.sourceforge.net <jan.nijtmans>2013-02-19 11:36:12 (GMT)
commitfde24af5a6823086112885e7b5dfaf0da153b354 (patch)
tree0b4fe40c61217c72dd682087696ae4a1236f9ff7 /generic/tclTrace.c
parent33bea9773fb937ed637a72fbd2f0bbae4735af49 (diff)
parent1d2553af513f0eb6dd5e0f30dbedc900a5ff8dfc (diff)
downloadtcl-fde24af5a6823086112885e7b5dfaf0da153b354.zip
tcl-fde24af5a6823086112885e7b5dfaf0da153b354.tar.gz
tcl-fde24af5a6823086112885e7b5dfaf0da153b354.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.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/generic/tclTrace.c b/generic/tclTrace.c
index 0f297a4..d7430ca 100644
--- a/generic/tclTrace.c
+++ b/generic/tclTrace.c
@@ -1485,7 +1485,11 @@ TclCheckExecutionTraces(
}
iPtr->activeCmdTracePtr = active.nextPtr;
if (state) {
- Tcl_RestoreInterpState(interp, state);
+ if (traceCode == TCL_OK) {
+ (void) Tcl_RestoreInterpState(interp, state);
+ } else {
+ Tcl_DiscardInterpState(state);
+ }
}
return traceCode;