From 0ebb072f9f988139ae158e648df3eeef0679153e Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Tue, 16 Feb 2021 15:28:21 -0500 Subject: [PATCH] Add regression test for extended table bounds check --- bootstraptest/test_ujit.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/bootstraptest/test_ujit.rb b/bootstraptest/test_ujit.rb index 65e20fa117..318d07c670 100644 --- a/bootstraptest/test_ujit.rb +++ b/bootstraptest/test_ujit.rb @@ -177,3 +177,23 @@ assert_normal_exit %q{ self end } + +# Test that getinstancevariable codegen checks for extended table size +assert_equal "nil\n", %q{ + class A + def read + @ins1000 + end + end + + ins = A.new + other = A.new + 10.times { other.instance_variable_set(:"@otr#{_1}", 'value') } + 1001.times { ins.instance_variable_set(:"@ins#{_1}", 'value') } + + ins.read + ins.read + ins.read + + p other.read +}