Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 423fb90fe718e9baa7ad7aa87d55d92106bb48ce
Ticket: 2017632fffffffffffffffffffffffffffffffff
NR-enable [catch] (and [if], [for], [foreach], [eval], ...)
User & Date: msofer on 2008-08-31 21:44:52
Changes

  1. icomment:
    Logged In: YES 
    user_id=148712
    Originator: YES
    
    REQUEST FOR OPINION (mainly dkf and aku)
    
    As a first step towards NRE-enabling [eval], I tried bytecompiling eval'ed scripts (just subst 0 for TCL_EVAL_DIRECT in tclCmdAH.c). This raises 5 errors in the testsuite, need feedback as to how serious they are. I tend to think somewhere "not serious at all" and "fixable":
    
    (a) [info frame] reports the wrong(?) thing
    ==== info-23.3 eval'd info frame, literal FAILED
    ==== Contents of test case:
    
        eval {
    info frame 0
        }
    
    ---- Result was:
    type source line 793 file /home/CVS/fossil/tmp/tests/info.test cmd {info frame 0} proc ::tcltest::RunTest
    ---- Result should have been (exact matching):
    type eval line 2 cmd {info frame 0} proc ::tcltest::RunTest
    ==== info-23.3 FAILED
    
    (b) 4 of the [interp recursionlimit] tests fail: interp-29.3.(7,8,10,11). It is the same problem in each:
    ==== interp-29.3.7 recursion limit error reporting FAILED
    ==== Contents of test case:
    
        interp create slave
        after 0 {interp recursionlimit slave 5}
        set r1 [slave eval {
            catch { # nesting level 1
        eval {# 2
            eval {# 3
        eval {# 4
            eval {# 5
         update
         set x ok
    }
        }
    }
        }
    } msg
        }]
        set r2 [slave eval { set msg }]
        interp delete slave
        list $r1 $r2
    
    ---- Result was:
    0 ok
    ---- Result should have been (exact matching):
    1 {too many nested evaluations (infinite loop?)}
    ==== interp-29.3.7 FAILED
    
    The error is caused by the fact that TEBC does not check the limits at each command, only every so many instructions (currently 64). If the tests would have updated the limit before the last nested eval, or called a non-bbc'ed command instead of 'set x ok', or attempted to do anything meaningful in that eval'ed script, the limit would have triggered.
    
    
  2. login: "msofer"
  3. mimetype: "text/plain"
  4. username: "msofer"