summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2023-11-02 09:15:48 -0700
committerGitHub <noreply@github.com>2023-11-02 09:15:48 -0700
commitad4f973ecd0a3481ff1abaa972d457e9f5b5fb4e (patch)
tree82c753f75cfd88d4c5df1583990607b484929b56 /test/ruby
parent5f130e2111db82eaf2c609e9cc7c000f9bac95be (diff)
YJIT: Always define method codegen table at boot (#8807)
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_yjit.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb
index 3ff78e658f..8adf50e271 100644
--- a/test/ruby/test_yjit.rb
+++ b/test/ruby/test_yjit.rb
@@ -85,6 +85,16 @@ class TestYJIT < Test::Unit::TestCase
RUBY
end
+ def test_yjit_enable_with_monkey_patch
+ assert_separately(%w[--yjit-disable], <<~RUBY)
+ # This lets rb_method_entry_at(rb_mKernel, ...) return NULL
+ Kernel.prepend(Module.new)
+
+ # This must not crash with "undefined optimized method!"
+ RubyVM::YJIT.enable
+ RUBY
+ end
+
def test_yjit_stats_and_v_no_error
_stdout, stderr, _status = invoke_ruby(%w(-v --yjit-stats), '', true, true)
refute_includes(stderr, "NoMethodError")