summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2024-07-12 09:27:32 -0400
committergit <svn-admin@ruby-lang.org>2024-07-12 13:50:00 +0000
commit6298667ff55126106dad8448096de3ed975f6644 (patch)
tree7deec4e3a294424abb1dccf27e1b036bf24abc29 /test
parentca99f86bd6157a3268a63ba36bda49c140428752 (diff)
[ruby/prism] When parsing an invalid write, still add to the local table
https://github.com/ruby/prism/commit/a54abc4d1b
Diffstat (limited to 'test')
-rw-r--r--test/prism/locals_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/prism/locals_test.rb b/test/prism/locals_test.rb
index 3c45d8b08b..ea61fd9499 100644
--- a/test/prism/locals_test.rb
+++ b/test/prism/locals_test.rb
@@ -9,6 +9,11 @@
# to test on the most recent versions.
return if !defined?(RubyVM::InstructionSequence) || RUBY_VERSION < "3.4.0"
+# In Ruby 3.4.0, the local table for method forwarding changed. But 3.4.0 can
+# refer to the dev version, so while 3.4.0 still isn't released, we need to
+# check if we have a high enough revision.
+return if RubyVM::InstructionSequence.compile("def foo(...); end").to_a[13][2][2][10].length != 1
+
# Omit tests if running on a 32-bit machine because there is a bug with how
# Ruby is handling large ISeqs on 32-bit machines
return if RUBY_PLATFORM =~ /i686/