diff options
author | Steve Bennett <steveb@workware.net.au> | 2016-09-05 09:35:18 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2016-09-05 09:35:18 +1000 |
commit | 1b79972ccb35d9fe6174c5c6f045a9b2fcbe0af8 (patch) | |
tree | 7815b412c76aca1441bd300054c4c5f8c49517f4 /regtest.tcl | |
parent | e5dc0167b5143048bf2f2d03703bcbdb287a60be (diff) | |
download | jimtcl-1b79972ccb35d9fe6174c5c6f045a9b2fcbe0af8.zip jimtcl-1b79972ccb35d9fe6174c5c6f045a9b2fcbe0af8.tar.gz jimtcl-1b79972ccb35d9fe6174c5c6f045a9b2fcbe0af8.tar.bz2 |
Fix a crash due to cached local command resolution
When a 'local' command is deleted, the proc epoch needs
to increase to ensure that subsequent lookups are re-resolved.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'regtest.tcl')
-rw-r--r-- | regtest.tcl | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/regtest.tcl b/regtest.tcl index 28bd43d..4f4b459 100644 --- a/regtest.tcl +++ b/regtest.tcl @@ -252,6 +252,21 @@ $f writable {incr y} $f close puts "TEST 34 PASSED" +# REGTEST 35 +# caching of command resolution after local proc deleted +set result {} +proc x {} { } +proc p {n} { + if {$n in {2 3}} { + local proc x {} { } + } + x +} +foreach i {1 2 3 4} { + p $i +} +puts "TEST 35 PASSED" + # TAKE THE FOLLOWING puts AS LAST LINE puts "--- ALL TESTS PASSED ---" |