summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2021-02-16 15:28:21 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:29 -0400
commit0ebb072f9f988139ae158e648df3eeef0679153e (patch)
tree1eb0116824333ad6f45ffdef747f3cc550018c61 /bootstraptest
parent980aa329b648f3412d3584575481181b8d42cd60 (diff)
Add regression test for extended table bounds check
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_ujit.rb20
1 files changed, 20 insertions, 0 deletions
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
+}