aboutsummaryrefslogtreecommitdiffstats
path: root/bootstraptest
diff options
context:
space:
mode:
authorMaxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>2023-08-03 16:09:18 -0400
committerGitHub <noreply@github.com>2023-08-03 16:09:18 -0400
commit98b4256aa7a558e19739ac1d39ba10179277e1f4 (patch)
treef7a286741d0fd6949b66dde8a6bc1a1f4c923654 /bootstraptest
parent132f097149af36cb77308d9fe1c1a94940ab2089 (diff)
downloadruby-98b4256aa7a558e19739ac1d39ba10179277e1f4.tar.gz
YJIT: handle expandarray_rhs_too_small case (#8161)
* YJIT: handle expandarray_rhs_too_small case YJIT: fix csel bug in x86 backend, add test Remove commented out lines Refactor expandarray to use chain guards Propagate Type::Nil when known Update yjit/src/codegen.rs Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> * Add missing counter, use get_array_ptr() in expandarray * Make change suggested by Kokubun to reuse loop --------- Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_yjit.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb
index 80d0ef00d8..6cc509f212 100644
--- a/bootstraptest/test_yjit.rb
+++ b/bootstraptest/test_yjit.rb
@@ -2276,6 +2276,17 @@ assert_equal '[1, 2, nil]', %q{
expandarray_rhs_too_small
}
+assert_equal '[nil, 2, nil]', %q{
+ def foo(arr)
+ a, b, c = arr
+ end
+
+ a, b, c1 = foo([0, 1])
+ a, b, c2 = foo([0, 1, 2])
+ a, b, c3 = foo([0, 1])
+ [c1, c2, c3]
+}
+
assert_equal '[1, [2]]', %q{
def expandarray_splat
a, *b = [1, 2]