Project

General

Profile

Actions

Bug #22646

open

parse.y: `argument stack underflow (-1)` on Braceless Hash Under `# shareable_constant_value: experimental_copy`

Bug #22646: parse.y: `argument stack underflow (-1)` on Braceless Hash Under `# shareable_constant_value: experimental_copy`

Added by steviejj (Steven Johnstone) 2 days ago.

Status:
Open
Assignee:
-
Target version:
-
ruby -v:
ruby 4.1.0dev (2026-11-26T13:52:03Z HEAD 17eecca74a) +PRISM [aarch64-linux]
[ruby-core:127737]

Description

Differential fuzzer (prism vs parse.y) find.

# shareable_constant_value: experimental_copy
while e
  B = [[[g: []]]]
end
ruby --parser=parse.y --disable-gems -e 'RubyVM::InstructionSequence.compile("#shareable_constant_value:experimental_copy\nwhile e\nB=[[[g:[]]]]end\n")'

Observed Output

-- raw disasm--------
   trace: 1
   0000 jump                 <L000>                                      (   2)
 <L004> [sp: 0, unremovable: 1, refcnt: 1]
   0002 putnil                                                           (   2)
 <L005> [sp: 1, unremovable: 0, refcnt: 1]
   0003 pop                                                              (   2)
   0004 jump                 <L000>                                      (   2)
 <L001> [sp: 0, unremovable: 1, refcnt: 6]
   trace: 1
   0006 putspecialobject     1                                           (   3)
   0008 newarray             1                                           (   3)
   0010 newarray             1                                           (   3)
   0012 newarray             1                                           (   3)
   0014 opt_send_without_block <calldata:make_shareable_copy, 1>         (   3)
   0016 putspecialobject     3                                           (   3)
*  0018 setconstant          :B                                          (   3)
 <L000> [sp: 0, unremovable: 0, refcnt: 2]
   0020 putself                                                          (   2)
   0021 opt_send_without_block <calldata:e, 0>                           (   2)
   0023 branchif             <L001>                                      (   2)
   adjust: [label: 4]
   0025 putnil                                                           (   2)
 <L002> [sp: -1, unremovable: 0, refcnt: 4]
   0026 leave                                                            (   3)
---------------------
<compiled>: <compiled>:3: argument stack underflow (-1) (SyntaxError)

No data to display

Actions

Also available in: PDF Atom