Actions
Bug #20344
closedargument stack underflow (-1)
Description
This file produces argument stack underflow, since ruby 2.5.
proc do
next if true
case nil
when "a"
next
when "b"
when "c"
proc {}
end
next unless true
end
-- raw disasm--------
trace: 100
0000 nop ( 1)
<L000> [sp: 0, unremovable: 1, refcnt: 5]
trace: 1
<L004> [sp: 0, unremovable: 0, refcnt: 1]
adjust: [label: 0]
0001 putnil ( 2)
0002 leave ( 13)
<L008> [sp: 1, unremovable: 0, refcnt: 1]
adjust: [label: 0]
0003 putnil ( 6)
0004 leave ( 13)
adjust: [label: 8]
0005 jump <L005> ( 5)
0007 pop ( 7)
0008 jump <L005> ( 7)
* 0010 pop ( 8)
trace: 1
<L011> [sp: -1, unremovable: 1, refcnt: 1]
0011 putself ( 9)
0012 send <calldata:proc, 0>, nil ( 9)
<L012> [sp: -1, unremovable: 0, refcnt: 2]
0015 pop ( 9)
<L005> [sp: 1, unremovable: 0, refcnt: 2]
trace: 1
0016 putnil ( 12)
<L001> [sp: -1, unremovable: 0, refcnt: 3]
trace: 200
0017 leave ( 13)
---------------------
Updated by tompng (tomoya ishida) 4 months ago
- Status changed from Open to Closed
Applied in changeset git|992596fb7af18a7f472589a607d0eb3fbb03b49a.
Fix next inside block argument stack underflow
[Bug #20344]
Fix compile_next adding removable adjust label
Updated by nagachika (Tomoyuki Chikanaga) 4 months ago
- Backport changed from 3.0: REQUIRED, 3.1: REQUIRED, 3.2: REQUIRED, 3.3: REQUIRED to 3.0: REQUIRED, 3.1: REQUIRED, 3.2: DONE, 3.3: REQUIRED
ruby_3_2 21c708ee802e1a59901eccc6448e40e8f72189b8 merged revision(s) 992596fb7af18a7f472589a607d0eb3fbb03b49a.
Updated by k0kubun (Takashi Kokubun) 3 months ago
- Backport changed from 3.0: REQUIRED, 3.1: REQUIRED, 3.2: DONE, 3.3: REQUIRED to 3.0: REQUIRED, 3.1: REQUIRED, 3.2: DONE, 3.3: DONE
ruby_3_3 d83b5633b16f4ddcece4ff924f21c5a5851470cf merged revision(s) 992596fb7af18a7f472589a607d0eb3fbb03b49a.
Actions
Like0
Like0Like0Like0