1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Add regression test for extended table bounds check

This commit is contained in:
Alan Wu 2021-02-16 15:28:21 -05:00
parent 980aa329b6
commit 0ebb072f9f

View file

@ -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
}