summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAaron Patterson <[email protected]>2025-04-29 10:02:00 -0700
committerAaron Patterson <[email protected]>2025-04-29 13:33:23 -0700
commit203614080f2e944abb190a130b07685b0373da03 (patch)
tree3b40d718a2fb6dc0470c444e5326f5d2db33e4fd /test
parente6974be5458907d4e809a84d775c3e6b7f4fcea9 (diff)
opt_new needs to happen after safe navigation
If safe navigation instructions happen first, we get a stack inconsistency error.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13205
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_optimization.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb
index d1cf765247..e39eafa5e5 100644
--- a/test/ruby/test_optimization.rb
+++ b/test/ruby/test_optimization.rb
@@ -1216,6 +1216,11 @@ class TestRubyOptimization < Test::Unit::TestCase
RUBY
end
+ def test_opt_new_with_safe_navigation
+ payload = nil
+ assert_nil payload&.new
+ end
+
def test_opt_new
pos_initialize = "
def initialize a, b