Project

General

Profile

Actions

Bug #21713

closed

Prism accepts pattern matching in modifier rescue followed by operators that shouldn't be allowed

Bug #21713: Prism accepts pattern matching in modifier rescue followed by operators that shouldn't be allowed

Added by tompng (tomoya ishida) 3 months ago. Updated 2 days ago.

Status:
Closed
Assignee:
Target version:
-
ruby -v:
ruby 4.0.0dev (2025-11-26T06:41:42Z master 43ed35de6c) +YJIT +MN +PRISM [arm64-darwin24]
[ruby-core:123915]

Description

These are syntax errors in parse.y but accepted in Prism

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

Updated by mame (Yusuke Endoh) 3 months ago Actions #1 [ruby-core:124082]

  • Status changed from Open to Assigned
  • Assignee set to prism

Updated by kddnewton (Kevin Newton) 2 days ago Actions #2

  • Status changed from Assigned to Closed

Applied in changeset git|8c7f4db893af4c9e40eab5810dc58737dc9010bb.


[ruby/prism] Fix modifier rescue pattern matching

[Bug #21713]

https://github.com/ruby/prism/commit/02c944c055

Actions

Also available in: PDF Atom