From: "nagachika (Tomoyuki Chikanaga) via ruby-core" <ruby-core@ml.ruby-lang.org>
To: ruby-core@ml.ruby-lang.org
Cc: "nagachika (Tomoyuki Chikanaga)" <noreply@ruby-lang.org>
Subject: [ruby-core:118871] [Ruby master Bug#20571] Compile error on for loop
Date: Sun, 18 Aug 2024 02:19:47 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-109443.20240818021947.10206@ruby-lang.org> (raw)
In-Reply-To: <redmine.issue-20571.20240610135232.10206@ruby-lang.org>
Issue #20571 has been updated by nagachika (Tomoyuki Chikanaga).
Backport changed from 3.1: REQUIRED, 3.2: REQUIRED, 3.3: REQUIRED to 3.1: REQUIRED, 3.2: DONE, 3.3: REQUIRED
ruby_3_2 commit:50399eebd96c76ce808ea4d84fe39693f585a531 merged revision(s) commit:1870505f478cc75993b296b7144a45137ace6937.
----------------------------------------
Bug #20571: Compile error on for loop
https://bugs.ruby-lang.org/issues/20571#change-109443
* Author: kddnewton (Kevin Newton)
* Status: Closed
* Backport: 3.1: REQUIRED, 3.2: DONE, 3.3: REQUIRED
----------------------------------------
```ruby
for _ in 1.5 or _ in []
end
```
raises a compile error for the current compiler only with
```
-- raw disasm--------
trace: 1
<L000> [sp: 0, unremovable: 1, refcnt: 1]
0000 putobject 1.5 ( 1)
0002 jump <L002> ( 1)
<L006> [sp: 1, unremovable: 1, refcnt: 1]
<L004> [sp: 1, unremovable: 0, refcnt: 0]
0004 pop ( 1)
* 0005 pop ( 1)
0006 putobject false ( 1)
<L002> [sp: 1, unremovable: 0, refcnt: 1]
0008 send <calldata:each, 0>, nil ( 1)
<L001> [sp: -1, unremovable: 0, refcnt: 2]
0011 leave ( 1)
---------------------
test.rb:1: argument stack underflow (-1)
test.rb: compile error (SyntaxError)
```
--
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/
next prev parent reply other threads:[~2024-08-18 2:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-10 13:52 [ruby-core:118270] " kddnewton (Kevin Newton) via ruby-core
2024-07-29 23:54 ` [ruby-core:118725] " jeremyevans0 (Jeremy Evans) via ruby-core
2024-07-30 0:49 ` [ruby-core:118726] " jeremyevans0 (Jeremy Evans) via ruby-core
2024-08-18 2:19 ` nagachika (Tomoyuki Chikanaga) via ruby-core [this message]
2024-09-02 10:05 ` [ruby-core:119008] " k0kubun (Takashi Kokubun) via ruby-core
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-109443.20240818021947.10206@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).