natalie-lang / natalie

a work-in-progress Ruby compiler, written in Ruby and C++
https://natalie-lang.org
MIT License
931 stars 61 forks source link

Handle regexp back references with an index that is too big #2187

Closed herwinw closed 2 months ago

herwinw commented 2 months ago

Short explanation: Prism uses a 32 bit unsigned int to store the index, indices larger than that are stored as 0. So the check node.number == 0 actually means node.number >= 2**32