Bug #20195
closed
3.3.0 YJIT mishandles ruby2_keywords splat into methods taking a rest parameter
Added by alanwu (Alan Wu) 7 months ago.
Updated 3 months ago.
Description
Check with:
ruby2_keywords def foo(*args) = args
def bar(*args, **kw) = [args, kw]
def pass_bar(*args) = bar(*args)
def body
args = foo(a: 1)
pass_bar(*args)
end
p body
$ ruby ../test.rb
[[{:a=>1}], {}]
$ ruby --yjit-call-threshold=1 ../test.rb
[[], {:a=>1}]
Fix at: https://github.com/ruby/ruby/pull/9621
- Subject changed from 3.3.0 YJIT mishandles splat into methods taking a rest parameter to 3.3.0 YJIT mishandles ruby2_keywords splat into methods taking a rest parameter
- Status changed from Open to Closed
- Description updated (diff)
- Description updated (diff)
- Status changed from Closed to Open
- Status changed from Open to Closed
Applied in changeset git|ac1e9e443a0d6a4d4c0801c26d1d8bd33d9eb431.
YJIT: Fix ruby2_keywords splat+rest and drop bogus checks
YJIT didn't guard for ruby2_keywords hash in case of splat calls that
land in methods with a rest parameter, creating incorrect results.
The compile-time checks didn't correspond to any actual effects of
ruby2_keywords, so it was masking this bug and YJIT was needlessly
refusing to compile some code. About 16% of fallback reasons in
lobsters
was due to the ISeq check.
We already handle the tagging part with
exit_if_supplying_kw_and_has_no_kw() and should now have a dynamic guard
for all splat cases.
Note for backporting: You also need 7f51959ff1.
[Bug #20195]
- Backport changed from 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED to 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONE
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0Like0