Skip to content

Commit 752ad7f

Browse files
Watson1978claude
andcommitted
Skip recursive-extension StackError spec on JRuby
The MessagePack::StackError behavior verified by this spec is specific to the C extension, which caps nesting at MSGPACK_UNPACKER_STACK_CAPACITY. The Java (JRuby) decoder has no equivalent guard and recurses until the JVM stack overflows, so the spec cannot assert MessagePack::StackError there. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 1b0cdf7 commit 752ad7f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

spec/factory_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,11 @@ class << Symbol
663663
end
664664

665665
it 'raises StackError instead of crashing on deeply nested recursive extensions' do
666+
# The C extension caps nesting at MSGPACK_UNPACKER_STACK_CAPACITY and raises
667+
# MessagePack::StackError. The Java (JRuby) decoder has no such guard and
668+
# recurses until the JVM stack overflows, so this behavior is CRuby-specific.
669+
skip if IS_JRUBY
670+
666671
recursive_type = Struct.new(:payload)
667672
factory = MessagePack::Factory.new
668673
factory.register_type(0x01,

0 commit comments

Comments
 (0)