[ruby-core:123915] [Ruby Bug#21713] Prism accepts pattern matching in modifier rescue followed by operators that shouldn't be allowed
Issue #21713 has been reported by tompng (tomoya ishida). ---------------------------------------- Bug #21713: Prism accepts pattern matching in modifier rescue followed by operators that shouldn't be allowed https://bugs.ruby-lang.org/issues/21713 * Author: tompng (tomoya ishida) * Status: Open * ruby -v: ruby 4.0.0dev (2025-11-26T06:41:42Z master 43ed35de6c) +YJIT +MN +PRISM [arm64-darwin24] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- These are syntax errors in parse.y but accepted in Prism ~~~ruby a rescue b => c in d a rescue b in c.. a rescue b => c.. a rescue b => c::itself a rescue b => c[] a rescue b => c[0] = 1 a rescue b => c ? 1 : 2 a rescue b => c || 2 ~~~ Found by this fuzzing script https://gist.github.com/tompng/551777b9b850b0428c9062745cf763db -- https://bugs.ruby-lang.org/
Issue #21713 has been updated by mame (Yusuke Endoh). Status changed from Open to Assigned Assignee set to prism ---------------------------------------- Bug #21713: Prism accepts pattern matching in modifier rescue followed by operators that shouldn't be allowed https://bugs.ruby-lang.org/issues/21713#change-115522 * Author: tompng (tomoya ishida) * Status: Assigned * Assignee: prism * ruby -v: ruby 4.0.0dev (2025-11-26T06:41:42Z master 43ed35de6c) +YJIT +MN +PRISM [arm64-darwin24] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- These are syntax errors in parse.y but accepted in Prism ~~~ruby a rescue b => c in d a rescue b in c.. a rescue b => c.. a rescue b => c::itself a rescue b => c[] a rescue b => c[0] = 1 a rescue b => c ? 1 : 2 a rescue b => c || 2 ~~~ Found by this fuzzing script https://gist.github.com/tompng/551777b9b850b0428c9062745cf763db -- https://bugs.ruby-lang.org/
participants (2)
-
mame (Yusuke Endoh) -
tompng (tomoya ishida)