Issue #22601 has been updated by k0kubun (Takashi Kokubun). Backport changed from 3.3: REQUIRED, 3.4: REQUIRED, 4.0: REQUIRED to 3.3: REQUIRED, 3.4: REQUIRED, 4.0: DONE ruby_4_0 commit:46e9a132f358793c5f113e8ab539eee958ac773b merged revision(s) commit:e5e6cd45db456b2a4d368f2a34598641319df630. ---------------------------------------- Bug #22601: parse.y fails to skip a bare 3-byte UTF-8 BOM https://bugs.ruby-lang.org/issues/22601#change-120157 * Author: steviejj (Steven Johnstone) * Status: Closed * ruby -v: ruby 4.0.9 (2026-10-23 revision 3e93b23afc) +PRISM [arm64-darwin27] * Backport: 3.3: REQUIRED, 3.4: REQUIRED, 4.0: DONE ---------------------------------------- Very minor divergence between prism and parse.y spotted in differential fuzzing. Tested on `ruby 4.0.9 (2026-10-23 revision 3e93b23afc) +PRISM [aarch64-linux]` and `ruby 4.1.0dev (2026-11-18T09:19:17Z HEAD ed3e747aa4) +PRISM [aarch64-linux]`. Executing a 3-byte `.rb` file containing only the BOM (`"\xEF\xBB\xBF"`) or evaluating it with `eval`: ```sh ruby --parser=parse.y -e 'eval("\xEF\xBB\xBF")' # => (eval at -e:1):1:in '<main>': undefined local variable or method '' for main (NameError) (exit 1) ruby --parser=prism -e 'eval("\xEF\xBB\xBF")' # => (exits 0) ``` ``` ruby -e 'pp RubyVM::AbstractSyntaxTree.parse("\xEF\xBB\xBF")' (SCOPE@1:0-1:3 tbl: [] args: nil body: (VCALL@1:0-1:3 :)) ``` -- https://bugs.ruby-lang.org/