From 86d682b82273fd98a4259df86f4303bc65a896b6 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 15 Aug 2013 19:55:26 +0000 Subject: Make sure the errors raised by execution traces become errors raised by the traced command, as documented. Deletion of the traced command was supressing that. --- generic/tclBasic.c | 2 +- tests/trace.test | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 8ab3acb..314b5fc 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -3642,7 +3642,7 @@ TclEvalObjvInternal( * implementation. */ - if (cmdEpoch != newEpoch) { + if (traceCode == TCL_OK && cmdEpoch != newEpoch) { checkTraces = 0; if (commandPtr) { Tcl_DecrRefCount(commandPtr); diff --git a/tests/trace.test b/tests/trace.test index 24279f5..9c01908 100644 --- a/tests/trace.test +++ b/tests/trace.test @@ -2658,6 +2658,13 @@ test trace-39.1 {bug #3485022: tracing Bc'ed commands} -setup { rename dotrace {} rename foo {} } -result {3 | 0 1 1} + +test trace-40.1 {execution trace errors become command errors} { + proc foo args {} + trace add execution foo enter {rename foo {}; error bar;#} + catch foo m + return -level 0 $m[unset m] +} bar # Delete procedures when done, so we don't clash with other tests # (e.g. foobar will clash with 'unknown' tests). -- cgit v0.12