Project

General

Profile

Actions

Bug #20344

closed

argument stack underflow (-1)

Added by nobu (Nobuyoshi Nakada) 9 months ago. Updated 4 months ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:117210]

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)
---------------------
Actions #1

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

Updated by k0kubun (Takashi Kokubun) 4 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
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0