Skip to content
  • Alan Wu's avatar
    dccfab0c
    YJIT: Always abandon the block when gen_branch() or defer_compilation() fails · dccfab0c
    Alan Wu authored
    In [1], we started checking for gen_branch failures, but I made two
    crucial mistakes. One, defer_compilation() had the same issue as
    gen_branch() but wasn't checked. Two, returning None from a codegen
    function does not throw away the block. Checking how gen_single_block()
    handles codegen functions, you can see that None terminates the block
    with an exit, but does not overall return an Err. This handling is fine
    for unimplemented instructions, for example, but incorrect in case
    gen_branch() fails. The missing branch essentially corrupts the
    block; adding more code after a missing branch doesn't correct the code.
    
    Always abandon the block when defer_compilation() or gen_branch() fails.
    
    [1]: cb661d7d
    Fixup: [1]
    dccfab0c
    YJIT: Always abandon the block when gen_branch() or defer_compilation() fails
    Alan Wu authored
    In [1], we started checking for gen_branch failures, but I made two
    crucial mistakes. One, defer_compilation() had the same issue as
    gen_branch() but wasn't checked. Two, returning None from a codegen
    function does not throw away the block. Checking how gen_single_block()
    handles codegen functions, you can see that None terminates the block
    with an exit, but does not overall return an Err. This handling is fine
    for unimplemented instructions, for example, but incorrect in case
    gen_branch() fails. The missing branch essentially corrupts the
    block; adding more code after a missing branch doesn't correct the code.
    
    Always abandon the block when defer_compilation() or gen_branch() fails.
    
    [1]: cb661d7d
    Fixup: [1]
Loading