ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: "k0kubun (Takashi Kokubun) via ruby-core" <ruby-core@ml.ruby-lang.org>
To: ruby-core@ml.ruby-lang.org
Cc: "k0kubun (Takashi Kokubun)" <noreply@ruby-lang.org>
Subject: [ruby-core:119010] [Ruby master Bug#20344] argument stack underflow (-1)
Date: Mon, 02 Sep 2024 10:10:36 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-109585.20240902101036.4@ruby-lang.org> (raw)
In-Reply-To: <redmine.issue-20344.20240318153722.4@ruby-lang.org>

Issue #20344 has been updated by k0kubun (Takashi Kokubun).

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 commit:d83b5633b16f4ddcece4ff924f21c5a5851470cf merged revision(s) commit:992596fb7af18a7f472589a607d0eb3fbb03b49a.

----------------------------------------
Bug #20344: argument stack underflow (-1)
https://bugs.ruby-lang.org/issues/20344#change-109585

* Author: nobu (Nobuyoshi Nakada)
* Status: Closed
* Backport: 3.0: REQUIRED, 3.1: REQUIRED, 3.2: DONE, 3.3: DONE
----------------------------------------
This file produces argument stack underflow, since ruby 2.5.

```ruby
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)
---------------------
```



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

      parent reply	other threads:[~2024-09-02 10:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-18 15:37 [ruby-core:117210] " nobu (Nobuyoshi Nakada) via ruby-core
2024-08-18  9:30 ` [ruby-core:118877] " nagachika (Tomoyuki Chikanaga) via ruby-core
2024-09-02 10:10 ` k0kubun (Takashi Kokubun) via ruby-core [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-109585.20240902101036.4@ruby-lang.org \
    --to=ruby-core@ml.ruby-lang.org \
    --cc=noreply@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).