From ee8be54ede03c2d1f37f4639dcff5b9a94722992 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 19 Feb 2013 09:50:12 +0000 Subject: Add test-case for Bug #2438181 (which passes in Tcl 8.4 but fails in 8.5/8.6). Provided by Poor Yorick --- tests/trace.test | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/trace.test b/tests/trace.test index 80bdb4a..9a0912d 100644 --- a/tests/trace.test +++ b/tests/trace.test @@ -1666,6 +1666,16 @@ test trace-21.11 {trace execution and alias} -setup { rename ::x {} } -result {:: ::} +proc set2 args { + set {*}$args +} + +test trace-21.12 {bug 2438181} -setup { + trace add execution set2 leave {puts one two three #;} +} -body { + set2 a hello +} -returnCodes error -result {wrong # args: should be "puts ?-nonewline? ?channelId? string"} + proc factorial {n} { if {$n != 1} { return [expr {$n * [factorial [expr {$n -1 }]]}] } return 1 -- cgit v0.12 From f8e35a6396aefc1ffbb6a104b8cfd659e1afa2d9 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 19 Feb 2013 10:53:29 +0000 Subject: revert mangling with "code" variable. This caused unrelated var.test failures. --- generic/tclTrace.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generic/tclTrace.c b/generic/tclTrace.c index fd7566d..9298897 100644 --- a/generic/tclTrace.c +++ b/generic/tclTrace.c @@ -1482,7 +1482,7 @@ TclCheckExecutionTraces( iPtr->activeCmdTracePtr = active.nextPtr; if (state) { if (traceCode == TCL_OK) { - traceCode = Tcl_RestoreInterpState(interp, state); + (void) Tcl_RestoreInterpState(interp, state); } else { Tcl_DiscardInterpState(state); } @@ -1632,7 +1632,7 @@ TclCheckInterpTraces( iPtr->activeInterpTracePtr = active.nextPtr; if (state) { if (traceCode == TCL_OK) { - traceCode = Tcl_RestoreInterpState(interp, state); + (void) Tcl_RestoreInterpState(interp, state); } else { Tcl_DiscardInterpState(state); } @@ -2726,7 +2726,7 @@ TclCallVarTraces( iPtr->flags &= ~(ERR_ALREADY_LOGGED); Tcl_DiscardInterpState(state); } else { - code = Tcl_RestoreInterpState((Tcl_Interp *)iPtr, state); + (void) Tcl_RestoreInterpState((Tcl_Interp *)iPtr, state); } DisposeTraceResult(disposeFlags,result); } else if (state) { -- cgit v0.12