diff options
| author | Nick Dower <nicholasdower@gmail.com> | 2025-05-16 05:18:28 +0200 |
|---|---|---|
| committer | Alan Wu <XrXr@users.noreply.github.com> | 2025-05-17 00:17:21 +0900 |
| commit | 4921845b61c6a1b539dd8a65fb265024b8e40523 (patch) | |
| tree | 340f45918afb26aabc67cec8da366e78b84c9f38 /include/ruby | |
| parent | 097d742a1ed53afb91e83aef01365d68b763357b (diff) | |
[Bug #21313] Handle `it` in rescue and ensure blocks.
The following is crashing for me:
```shell
ruby --yjit --yjit-call-threshold=1 -e '1.tap { raise rescue p it }'
ruby: YJIT has panicked. More info to follow...
thread '<unnamed>' panicked at ./yjit/src/codegen.rs:2402:14:
...
```
It seems `it` sometimes points to the wrong value:
```shell
ruby -e '1.tap { raise rescue p it }'
false
ruby -e '1.tap { begin; raise; ensure; p it; end } rescue nil'
false
```
But only when `$!` is set:
```shell
ruby -e '1.tap { begin; nil; ensure; p it; end }'
1
ruby -e '1.tap { begin; nil; rescue; ensure; p it; end }'
1
ruby -e '1.tap { begin; raise; rescue; ensure; p it; end }'
1
```
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13360
Diffstat (limited to 'include/ruby')
0 files changed, 0 insertions, 0 deletions
