diff options
author | Alan Wu <[email protected]> | 2024-11-08 14:09:55 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2024-11-08 14:09:55 -0500 |
commit | dccfab0c5348629223080bfd0cfd82be4163c9ad (patch) | |
tree | 27855a7eacd1c37dab202b455d1b38c9458c231d /ruby.c | |
parent | 6767117b07ecb825edb7ee82a27d7d05b6a9b79a (diff) |
YJIT: Always abandon the block when gen_branch() or defer_compilation() fails
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]: cb661d7d82984cdb54485ea3f4af01ac21960882
Fixup: [1]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12035
Merged-By: XrXr
Diffstat (limited to 'ruby.c')
0 files changed, 0 insertions, 0 deletions