Actions
Bug #21085
closed[BUG] Stack consistency error with -ne
Bug #21085:
[BUG] Stack consistency error with -ne
Description
Files
Actions
Added by segiddins (Samuel Giddins) over 1 year ago. Updated over 1 year ago.
Description
Files
| ruby-2025-01-21-125203.ips (9.83 KB) ruby-2025-01-21-125203.ips | segiddins (Samuel Giddins), 01/21/2025 08:52 PM |
This succeeds with the parse.y parser, so it seems to be a Prism compiler bug:
Good catch.
❯ ruby --dump=insns -vne '' --parser=parse.y
ruby 3.4.1 (2024-12-25 revision 48d4efcb85) [arm64-darwin24]
== disasm: #<ISeq:<main>@-e:1 (1,0)-(1,0)>
0000 jump 4 ( 1)
0002 putnil
0003 pop
0004 putself
0005 getglobal :$/
0007 opt_send_without_block <calldata!mid:gets, argc:1, FCALL|ARGS_SIMPLE>
0009 branchif 4
0011 putnil
0012 leave
❯ ruby --dump=insns -vne '' --parser=prism
ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin24]
== disasm: #<ISeq:<main>@-e:1 (1,0)-(1,0)>
0000 jump 7 ( 1)[Li]
0002 putnil
0003 pop
0004 jump 7
0006 putnil
0007 putself
0008 getglobal :$/
0010 opt_send_without_block <calldata!mid:gets, argc:1, FCALL|ARGS_SIMPLE>
0012 branchif 6
0014 putnil
0015 leave
Applied in changeset git|241ada7b1ca4fd71dc47a83d912ee25162a555d9.
[ruby/prism] Do not put empty statements in while because of -n
Fixes [Bug #21085]
ruby_3_4 cd395232b0491f9c4463c5889bab8d2c050e75e2 merged revision(s) 241ada7b1ca4fd71dc47a83d912ee25162a555d9.