From 286c07f0dcd7999bfb9cb4889125ebce59dca4cc Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Tue, 7 Dec 2021 15:37:32 -0500 Subject: YJIT: Remove guard_self_is_heap() It's superseded by functionality added to jit_guard_known_klass(). In weird situations such as the ones in the included test, guard_self_is_heap() triggered assertions. Co-authored-by: Jemma Issroff --- bootstraptest/test_yjit.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'bootstraptest') diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb index 140365ee0c..e50d78a9dc 100644 --- a/bootstraptest/test_yjit.rb +++ b/bootstraptest/test_yjit.rb @@ -1,3 +1,14 @@ +assert_equal '[nil, nil, nil, nil, nil, nil]', %q{ + [NilClass, TrueClass, FalseClass, Integer, Float, Symbol].each do |klass| + klass.class_eval("def foo = @foo") + end + + [nil, true, false, 0xFABCAFE, 0.42, :cake].map do |instance| + instance.foo + instance.foo + end +} + assert_equal '0', %q{ # This is a regression test for incomplete invalidation from # opt_setinlinecache. This test might be brittle, so -- cgit v1.2.3