[前][次][番号順一覧][スレッド一覧]

ruby-changes:68773

From: Alan <ko1@a...>
Date: Thu, 21 Oct 2021 08:13:30 +0900 (JST)
Subject: [ruby-changes:68773] 0ebb072f9f (master): Add regression test for extended table bounds check

https://git.ruby-lang.org/ruby.git/commit/?id=0ebb072f9f

From 0ebb072f9f988139ae158e648df3eeef0679153e Mon Sep 17 00:00:00 2001
From: Alan Wu <XrXr@u...>
Date: Tue, 16 Feb 2021 15:28:21 -0500
Subject: 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{ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_ujit.rb#L177
     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
+}
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]