diff options
author | ywenc <ywenc@github.com> | 2024-01-12 10:41:58 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-12 15:41:58 +0000 |
commit | 16624ef463f214367720b7cf486e43e48a2df4e6 (patch) | |
tree | a998bc5feddc2df038f0376061e6130fd61ca327 /bootstraptest | |
parent | 524770d3dc8f44a5caca5533f22297d1e0dd5d32 (diff) |
YJIT: expandarray for non-arrays (#9495)
* YJIT: expandarray for non-arrays
Co-authored-by: John Hawthorn <john@hawthorn.email>
* Skip the new test on RJIT
* Increment counter for to_ary exit
---------
Co-authored-by: John Hawthorn <john@hawthorn.email>
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_yjit.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb index aaf70e7b93..0e8c4a0a06 100644 --- a/bootstraptest/test_yjit.rb +++ b/bootstraptest/test_yjit.rb @@ -2494,6 +2494,23 @@ assert_equal '[:not_array, nil, nil]', %q{ expandarray_not_array(obj) } +assert_equal '[1, 2]', %q{ + class NilClass + private + def to_ary + [1, 2] + end + end + + def expandarray_redefined_nilclass + a, b = nil + [a, b] + end + + expandarray_redefined_nilclass + expandarray_redefined_nilclass +} unless rjit_enabled? + assert_equal '[1, 2, nil]', %q{ def expandarray_rhs_too_small a, b, c = [1, 2] |