|
2024-05-13
| ||
| 13:25 | test illustrating bug [31fd84270644f67d] (and [9889f96f4da77e3b]) check-in: 81c5544b70 user: sebres tags: bug-31fd84270644f67d | |
| 13:09 | • New ticket [31fd842706] Interim increment of iPtr->compileEpoch causes reset ... artifact: 9a03f2d282 user: sebres | |
Interim increment of iPtr->compileEpoch causes reset of line-number
Open31fd84270644f67d4ad8d762293be12439ba237cCreated 3 years agoUpdated 3 years ago
Descriptionwiki2024-05-13 13:09:34
Continuation of [9889f96f4da77e3b].
An increment of compile-epoch and following switch to direct eval causes that tcl starts to evaluate rest of the script from scratch without to consider that this is a continuation of script (line 3 in followed example) for whatever reason...
Here is a test case illustrating the behaviour:
set c {
puts ===[incr ::cntr]===; if {$::cntr == 1} {puts **BUMP**; testbumpinterpepoch};
if 1 {
puts [info frame 0]
}
}
time $c 2
The result:
===1===
**BUMP**
type eval line 2 cmd {info frame 0} level 0
===2===
type eval line 4 cmd {info frame 0} level 0
How one can see epoch bump causes a reset of the line-number.
How to reproduce it simply:
./tcltest <<< 'set c [subst -nocommands -novariables {puts ===[incr ::cntr]===; if {$::cntr == 1} {puts **BUMP**; testbumpinterpepoch};\n\nif 1 {\nputs [info frame 0]\n}}]; puts $c; time $c 2'
Log in (anonymous is fine) to add a comment.