Skip to content

call and match bypasses bounds check #79

@andrewchambers

Description

@andrewchambers
use std

const main = {
    var name
    var path = "/xxx"[:]

    match std.strfind(path, "/")
    | `std.Some i:
        name = path[0:i-1]
    | `std.None:
    ;;
    std.put("FAIL\n")
}
ac@black:~/Desktop/bug$ mbld -R bug.myr 
/tmp/runmyr1962868523...
    6m  bug.myr 
    ld  -o /tmp/runmyr1962868523 /usr/local/lib/myr/_myrrt.o bug.o -L/usr/local/lib/myr -lstd -lsys 
    /tmp/runmyr1962868523   
FAIL

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions