[pull] master from ruby:master#1118
Merged
Merged
Conversation
We side-exit when HIR uses not-yet-implemented backend features like CCall with >6 args. This ends the current block but does not prevent dominated blocks from being compiled. This could cause a dominated block to reference a (now dead) SSA value produced via or after the side-exit point. Even though the dominated block will never get executed in JIT code, it would crash on compile because `get_opnd` checks that the SSA value has been populated. Don't emit C calls from HIR that the LIR backend cannot handle. Emitting calls to C functions with more than 6 arguments (i.e. arguments passed on the stack) is still a TODO.
Co-authored-by: Alan Wu <alanwu@ruby-lang.org>
As you may know, `as` casts can be dangerous since they may be lossy, and with type inference, it's hard to tell what kind of conversion is happening. This commit removes the safe `as i32` casts from members of `jit_bindgen_constants` enum. This builds, so we know all the constants fit in i32, with this, they match what `Assembler` expects without the need to cast.
Previously, we unconditionally passed to the callee `GET_LEP(calling_frame)[VM_ENV_DATA_INDEX_SPECVAL]`, which in case the block containing super() is in e.g. a `class`, did not resolve to a block handler at all. Properly locate the block handler using logic used in Kernel#block_given? and defined?(yield). Rename BlockHandler::LEPSpecVal to FindFromCurrentFrame to reflect this change, as the block handler is not always in LEP. [Bug #22116]
This fixes two issues: If a lockfile has a platform variant only bundler will install the ruby variant but then fail at setup time because it only looks for the platform version. The solution to that is to keep ruby platform variants in the lockfile even if ruby is not (or cannot) be added to the PLATFORMS. Now you will get an error if you need the ruby variant but it isn't in the lockfile, and you can actually resolve the issue by putting the ruby variant in the lockfile! ruby/rubygems@564bb9e517
In the call branch of `curry`, `passed` is the only reference keeping the freshly built argument array alive, yet its backing buffer is handed to `rb_proc_call_with_block` as `argv` via `RARRAY_CONST_PTR(passed)`. After taking that pointer `passed` is otherwise unused, so the compiler may drop it before the call returns. Conservative stack marking then fails to find the array, and a GC triggered during the call (e.g. under GC.stress) can reclaim it while `argv` still points into its (embedded) buffer, crashing with: [BUG] try to mark T_NONE object (... parent: T_ARRAY ...) It also shows up as silent argument corruption, e.g. a curried proc raising "false can't be coerced into Integer", which is how it surfaced as a flaky Proc#curry spec failure in CI. Add RB_GC_GUARD(passed) to keep the array live until the call returns. Note that `curry` calls with kw_splat == 0, so the argv-rewriting path in invoke_block_from_c_proc (the rb_proc_call_kw / bd16973 case) is not reached here; this is purely a liveness issue, not a write-barrier one. The added test reproduces the crash deterministically under GC.stress. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The name resolution that was inlined at the top of warning? mixed the cheap SINCE pre-filter with the costly policy checks, making it hard to test in isolation. Split it into a side-effect-free find_gem returning the normalized feature, gem name, and subfeature flag, and add direct unit tests for it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
force_activate has nothing to do with detecting or warning about bundled gems; it activates an undeclared bundled gem for binding.irb and bundle console. Delimit it with a section comment so the file's two responsibilities are no longer visually intertwined. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The caller-frame walking, the bootsnap prefix stripping, and the thread-local suppression list were all added as point fixes whose rationale lived only in the commit history. Record why uplevel matches both "replace_require" and "require" base_labels (the former is the define_method block), why build_message skips exactly three frames and how that count is coupled to the call depth, and that prelude.rb drives the suppression list for binding.irb. Name the require base_labels as REQUIRE_LABELS while here. [Bug #20450] [Bug #21723] Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The section-divider comment rendered as verbatim text. Write it as a plain RDoc method comment so it reads as documentation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )