-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[COMPILER] Seg fault on interpolated regex with once #2047
Comments
I don't think this is related to once, it's just interpolation. I can get the same segv with the following: s = 1
/#{s}/ I'll keep looking into it, just wanted to note that it's not |
eileencodes
changed the title
[COMPILER] Seg fault on interpolated regex with once
[COMPILER] Seg fault on interpolated regex
Dec 12, 2023
Ugg, sorry I was running the wrong file. It is the |
eileencodes
changed the title
[COMPILER] Seg fault on interpolated regex
[COMPILER] Seg fault on interpolated regex with once
Dec 12, 2023
eileencodes
added a commit
to eileencodes/ruby
that referenced
this issue
Dec 12, 2023
When you have an interpolated regex with a `once` flag and local variable is outside the block created by the `once` flag, Prism would see a segv. This is because it was not taking the depth into account. To fix this, we need to add 1 to the `local_depth_offset` on the `scope`. Fixes: ruby/prism#2047
This should be fixed with ruby/ruby#9207 |
jemmaissroff
pushed a commit
to ruby/ruby
that referenced
this issue
Dec 12, 2023
When you have an interpolated regex with a `once` flag and local variable is outside the block created by the `once` flag, Prism would see a segv. This is because it was not taking the depth into account. To fix this, we need to add 1 to the `local_depth_offset` on the `scope`. Fixes: ruby/prism#2047
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is a seg fault when we compile interpolated regex with the once flag.
Minimal repro to compile with Prism is here:
I found this by running the following test:
RUBY_ISEQ_DUMP_DEBUG=prism make test/ruby/test_basicinstructions.rb
The text was updated successfully, but these errors were encountered: