Skip to content
  • Alan Wu's avatar
    aeb08bc8
    YJIT: Fix String#setbyte crashing for converted arguments · aeb08bc8
    Alan Wu authored
    Previously, passing objects that respond to #to_int to `String#setbyte`
    resulted in a crash when compiled by YJIT. This was due to the lazily
    pushed frame from rb_yjit_lazy_push_frame() lingering and not being
    popped by an exception as expected.
    
    The fix is to ensure that `ec->cfp` is restored to before the lazy frame
    push in case the method call for conversion succeeds. Right now, this is
    only for conversion to integers.
    
    Found running `ruby/spec`.
    
    * clarify comment
    
    We just need to make sure `ec->cfp` is always preserved and this can
    convert without rising when `raise` is true.
    aeb08bc8
    YJIT: Fix String#setbyte crashing for converted arguments
    Alan Wu authored
    Previously, passing objects that respond to #to_int to `String#setbyte`
    resulted in a crash when compiled by YJIT. This was due to the lazily
    pushed frame from rb_yjit_lazy_push_frame() lingering and not being
    popped by an exception as expected.
    
    The fix is to ensure that `ec->cfp` is restored to before the lazy frame
    push in case the method call for conversion succeeds. Right now, this is
    only for conversion to integers.
    
    Found running `ruby/spec`.
    
    * clarify comment
    
    We just need to make sure `ec->cfp` is always preserved and this can
    convert without rising when `raise` is true.
Loading