From: "k0kubun (Takashi Kokubun) via ruby-core" Date: 2024-09-02T10:05:01+00:00 Subject: [ruby-core:119008] [Ruby master Bug#20571] Compile error on for loop Issue #20571 has been updated by k0kubun (Takashi Kokubun). Backport changed from 3.1: REQUIRED, 3.2: DONE, 3.3: REQUIRED to 3.1: REQUIRED, 3.2: DONE, 3.3: DONE ruby_3_3 commit:6a4e79533b4454392f3afdfa0c4d35b763b68466. ---------------------------------------- Bug #20571: Compile error on for loop https://bugs.ruby-lang.org/issues/20571#change-109583 * Author: kddnewton (Kevin Newton) * Status: Closed * Backport: 3.1: REQUIRED, 3.2: DONE, 3.3: DONE ---------------------------------------- ```ruby for _ in 1.5 or _ in [] end ``` raises a compile error for the current compiler only with ``` -- raw disasm-------- trace: 1 [sp: 0, unremovable: 1, refcnt: 1] 0000 putobject 1.5 ( 1) 0002 jump ( 1) [sp: 1, unremovable: 1, refcnt: 1] [sp: 1, unremovable: 0, refcnt: 0] 0004 pop ( 1) * 0005 pop ( 1) 0006 putobject false ( 1) [sp: 1, unremovable: 0, refcnt: 1] 0008 send , nil ( 1) [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/