From 67c2cdc59a5fc8a82804c72a30a2d23ba36f2366 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Tue, 8 Jun 2021 07:52:57 -0700 Subject: Implement gen_getlocal This extracts the generation code from getlocal_wc1, since this is the same just with more loops inside vm_get_ep. --- bootstraptest/test_yjit.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'bootstraptest') diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb index 5bf415889e..51c82b55b5 100644 --- a/bootstraptest/test_yjit.rb +++ b/bootstraptest/test_yjit.rb @@ -1021,3 +1021,17 @@ assert_equal 'foo123', %q{ make_str("foo", 123) make_str("foo", 123) } + +# getlocal with 2 levels +assert_equal '7', %q{ + def foo(foo, bar) + while foo > 0 + while bar > 0 + return foo + bar + end + end + end + + foo(5,2) + foo(5,2) +} -- cgit v1.2.3