summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordgp <dgp@noemail.net>2012-02-06 17:21:56 (GMT)
committerdgp <dgp@noemail.net>2012-02-06 17:21:56 (GMT)
commit286d3aa4aa0cdddbdd50110aa5ece2458b5fe574 (patch)
tree597c89d3a8efa09752f9f09fcaaf4bc9588a86f6 /tests
parent2cc1d3954e642f2ce3be10a1baa2b2c26e31ed6c (diff)
downloadtcl-286d3aa4aa0cdddbdd50110aa5ece2458b5fe574.zip
tcl-286d3aa4aa0cdddbdd50110aa5ece2458b5fe574.tar.gz
tcl-286d3aa4aa0cdddbdd50110aa5ece2458b5fe574.tar.bz2
3484621 Invalidate bytecode when exec traces are added/removed from compiled cmd.
FossilOrigin-Name: 4b0a6f78649b52d5be4498a35e4a79a1c5ca6181
Diffstat (limited to 'tests')
-rw-r--r--tests/trace.test33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/trace.test b/tests/trace.test
index 1555d63..80bdb4a 100644
--- a/tests/trace.test
+++ b/tests/trace.test
@@ -2404,6 +2404,39 @@ test trace-34.6 {Bug 1458266} -setup {
rename isTracedInside_2 {}
} -result ok
+test trace-39 {bug #3484621: tracing Bc'ed commands} -setup {
+ set ::traceLog 0
+ set ::traceCalls 0
+ set ::bar [list 0 1 2 3]
+ set res {}
+ proc dotrace args {
+ incr ::traceLog
+ }
+ proc foo {} {
+ incr ::traceCalls
+ # choose a BC'ed command that is 'unlikely' to interfere with tcltest's
+ # internals
+ lset ::bar 1 2
+ }
+} -body {
+ foo
+ lappend res $::traceLog
+
+ trace add execution lset enter dotrace
+ foo
+ lappend res $::traceLog
+
+ trace remove execution lset enter dotrace
+ foo
+ lappend res $::traceLog
+
+ linsert $res 0 $::traceCalls |
+} -cleanup {
+ unset ::traceLog ::traceCalls ::bar res
+ rename dotrace {}
+ rename foo {}
+} -result {3 | 0 1 1}
+
# Delete procedures when done, so we don't clash with other tests
# (e.g. foobar will clash with 'unknown' tests).
catch {rename foobar {}}