summaryrefslogtreecommitdiff
path: root/include/ruby/ruby.h
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2024-10-23 10:17:08 -0400
committerGitHub <noreply@github.com>2024-10-23 10:17:08 -0400
commitcb661d7d82984cdb54485ea3f4af01ac21960882 (patch)
tree83e41c8412cda065c66b3fcc1d0bb5f6e56c349c /include/ruby/ruby.h
parenta6c4a842db78ce61dc823eaf055eb3373e4b296d (diff)
YJIT: Check when gen_branch() fails
We got some core dumps in the wild where a PendingBranch had everything as None, leading to a panic unwrapping in PendingBranch::into_branch(). This happened while compiling a `branchif`. It seems that the only way this can happen is when core::gen_branch() fails, but not due to OOM. We wouldn't have reach into_branch() when OOM, and the only way to not leave markers that would've set the branch's start_addr to some value in gen_branch() is for set_target() to fail, causing an early return. Unfortunately, it's hard to tell the exact sequence of events that led to this situation, but regardless, the dumps show us that we should check for errors in gen_branch(). Because gen_branch() is used deep in the stack during compilation (e.g. guard_known_class() -> jit_chain_guard() -> gen_branch()), it'd be bad for compile speed to propagate the error everywhere, not to mention the massive patch required. Opt for a flag checked near the end of compilation.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11938 Merged-By: XrXr
Diffstat (limited to 'include/ruby/ruby.h')
0 files changed, 0 insertions, 0 deletions