Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2277063a47b6af3e38d9c4d6e60e1536481640b4
Ticket: 3530230fffffffffffffffffffffffffffffffff
multi-level return from source in safe interps
User & Date: dkf on 2012-05-28 13:23:59
Changes

  1. assignee changed to: "dgp"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    I was trying to ensure that [return -level 2] works inside a sourced script in a safe interpreter (created with safe::interpCreate so using some aliases, including for [source]) and I found that the test below caused a crash. The crash doesn't appear to be related to the implementation of the aliased version of [source]; I tried several and got a crash every time.
    
    test safe-8.10 {safe source and return} -setup {
        set returnScript [makeFile {return -level 2 "ok"} return.tcl]
        catch {safe::interpDelete $i}
    } -body {
        safe::interpCreate $i
        set token [safe::interpAddToAccessPath $i [file dirname $returnScript]]
        $i eval [list apply {filename {
    source $filename
    error boom
        }} $token/[file tail $returnScript]]
    } -cleanup {
        catch {safe::interpDelete $i}
        removeFile $returnScript
    } -result ok
    
    I'm not 100% sure that the test is right, but I'm sure it shouldn't crash…
    
  4. foundin changed to: "obsolete: 8.6b2"
  5. is_private changed to: "0"
  6. priority changed to: "8"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "dkf"
  10. subsystem changed to: "45. Parsing and Eval"
  11. title changed to: "multi-level return from source in safe interps"
  12. type changed to: "Bug"