From: "k0kubun (Takashi Kokubun) via ruby-core" Date: 2026-05-11T20:46:09+00:00 Subject: [ruby-core:125463] [Ruby Bug#22004] parse.y doesn't executes loop body with `while true || true` condition Issue #22004 has been updated by k0kubun (Takashi Kokubun). Backport changed from 3.3: WONTFIX, 3.4: DONE, 4.0: REQUIRED to 3.3: WONTFIX, 3.4: DONE, 4.0: DONE ruby_4_0 commit:b18acb27c3f1b1ae26bbae6e53e94e246dc0e973 merged revision(s) commit:7f4f3c8ee7cde795dc27be753796fc7ea8318565. ---------------------------------------- Bug #22004: parse.y doesn't executes loop body with `while true || true` condition https://bugs.ruby-lang.org/issues/22004#change-117270 * Author: Earlopain (Earlopain _) * Status: Closed * ruby -v: ruby 4.1.0dev (2026-04-15T13:47:25Z master d077df24a2) +PRISM [x86_64-linux] * Backport: 3.3: WONTFIX, 3.4: DONE, 4.0: DONE ---------------------------------------- ```rb while true || true puts 1 end ``` This should never exit but with parse.y, the body is never executed. It seems to happen when one of the conditions is a truthy literal. Something similar happens with `unitl`: ```rb until false && true puts 1 end ``` By moving the literals out to methods that just return them, it behaves like I would expect. Seems to have started happening in Ruby 3.3. -- 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/