diff options
author | Alan Wu <[email protected]> | 2024-06-03 18:40:51 -0400 |
---|---|---|
committer | Alan Wu <[email protected]> | 2024-06-03 20:20:02 -0400 |
commit | c4056b0e43eea61ff88130e87d752957d4900a2b (patch) | |
tree | 41d7a688e760e517310d6dbc0d0a74211a024e94 | |
parent | e7e83a313c6aac9d57e17a021c24a9c8e2167cca (diff) |
YJIT: Add another regression test for empty splat
Follow-up for 6c8ae44a388e5c03b7db90376af3652007b574e8 ("YJIT: Fix out
of bounds access when splatting empty array"). This test crashes Ruby
3.3.2.
-rw-r--r-- | bootstraptest/test_yjit.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb index 76406ab601..d50b59ccce 100644 --- a/bootstraptest/test_yjit.rb +++ b/bootstraptest/test_yjit.rb @@ -4992,3 +4992,15 @@ assert_equal '1', %q{ array.clear test_body(array) } + +# regression test for splatting empty array to cfunc +assert_normal_exit %q{ + def test_body(args) = Array(1, *args) + + test_body([]) + 0x100.times do + array = Array.new(100) + array.clear + test_body(array) + end +} |