Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
YJIT: Fix missing arity check for splat calls to methods with optionals
Previously, for splat callsites that land in methods with optional parameters, we didn't reject the case where the caller supplies too many arguments. Accepting those calls previously caused YJIT to construct corrupted control frames, which leads to crashes if the callee uses certain stack walking methods such as Kernel#raise and String#gsub (for setting up the frame-local `$~`). Example crash in a debug build: Assertion Failed: ../vm_core.h:1375:VM_ENV_FLAGS:FIXNUM_P(flags) ruby 3.3.0dev (2023-12-06T20:38:22Z master a57186b) +YJIT dev [x86_64-linux] -- Control frame information ----------------------------------------------- c:0005 p:---- s:0021 e:000020 CFUNC :raise Assertion Failed: ../vm_core.h:1375:VM_ENV_FLAGS:FIXNUM_P(flags) ruby 3.3.0dev (2023-12-06T20:38:22Z master a57186b) +YJIT dev [x86_64-linux] Crashed while printing bug report
- Loading branch information