summaryrefslogtreecommitdiffstats
path: root/generic/tclTrace.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-02-19 11:36:12 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-02-19 11:36:12 (GMT)
commit3eafe75fbc925da366e32a959d479a254ebfc02a (patch)
tree0b4fe40c61217c72dd682087696ae4a1236f9ff7 /generic/tclTrace.c
parent34480654e98d2543e4d9a16e4cd5cbcc5630b604 (diff)
parentf8e35a6396aefc1ffbb6a104b8cfd659e1afa2d9 (diff)
downloadtcl-3eafe75fbc925da366e32a959d479a254ebfc02a.zip
tcl-3eafe75fbc925da366e32a959d479a254ebfc02a.tar.gz
tcl-3eafe75fbc925da366e32a959d479a254ebfc02a.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;