|
2007-07-22
| ||
| 02:41 | • Ticket [1752146fff] command limit is never reached in loops status still Clo... artifact: 2b24f47272 user: dkf | |
|
2007-07-12
| ||
| 04:25 | • Ticket [1752146fff]: 4 changes artifact: 2556ed14ac user: msofer | |
| 04:25 | • Closed ticket [1752146fff]. artifact: 887a674eb7 user: msofer | |
| 01:50 | • Ticket [1752146fff]: 5 changes artifact: 2b053c18eb user: msofer | |
|
2007-07-11
| ||
| 18:34 | • New ticket [1752146fff]. artifact: 0bd3b2acbc user: nobody | |
command limit is never reached in loops
Closed / Fixed1752146fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2007-07-11 18:34:07
Hi,
*** release 8.5a6 - 2007-04-25
in some cases, while interpreting some very short loop code, the command limit of the interpreter is never reached.
For example, the following code never reach the command limit :
*****************
interp create testlimit
testlimit eval {
proc testlimit {} {
while 1 {
set b 22
}
}
}
interp limit testlimit commands -value 303
testlimit eval testlimit
******************
As well, the following code never reach the command limit :
*****************
interp create testlimit
testlimit eval {
set b 22
proc testlimit {} {
while 1 {
incr b
}
}
}
interp limit testlimit commands -value 303
testlimit eval testlimit
******************
Conversely, the following code aborts when the command limit is reached (correct behavior) :
*****************
interp create testlimit
testlimit eval {
set b 22
proc testlimit {} {
while 1 {
set b 22
set a 22
}
}
}
interp limit testlimit commands -value 303
testlimit eval testlimit
******************
msoferplain2007-07-12 01:50:55
Logged In: YES user_id=148712 Originator: NO The problem seems to be caused by the optimisation of INST_START_CMD (2007-04-01), and require for its manifestation: (a) a 'while 1' loop with (b) a single bytecoded command in the body In this case all the bytecode in the loop is atmdStart, and there is no ISC within the loop. Note also that the 'deep cause' is that the commands are miscounted: the first command in the loop body will be counted just once, and not at each iteration. Again, only on 'while 1' which starts the body immediately (when there is no condition a jump is optimised away by the compiler).
msoferplain2007-07-12 04:25:46
Logged In: YES user_id=148712 Originator: NO Misdiagnosis: problem present with 8.5a5, which is earlier than that patch. It was caused by faulty avoidance of ISC when the very first opcode in a script is within a loop body - as produced by 'while 1'.
msofer Ticket [1752146fff]: 4 changes
[History diff]2007-07-12 04:25:47
dkf Ticket [1752146fff]: 1 change
[History diff]2007-07-22 02:41:44
Log in (anonymous is fine) to add a comment.