Commit 85146a5
authored
ZJIT: Use CFP_PC in warn_unused_block for outlined PC (ruby#16649)
warn_unused_block uses the caller's PC to build a dedup key for the
unused block warning table. When called from ZJIT-compiled code via
rb_vm_send, cfp->pc may be stale (poisoned or uninitialized) because
ZJIT stores the real PC in cfp->jit_return instead.
Use CFP_PC() which reads from jit_return when available, falling back
to cfp->pc for interpreter frames. This prevents the dedup key from
being based on a garbage PC value that could randomly collide with
prior entries, suppressing warnings that should be emitted.1 parent e957b3a commit 85146a5
2 files changed
Lines changed: 28 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3219 | 3219 | | |
3220 | 3220 | | |
3221 | 3221 | | |
3222 | | - | |
| 3222 | + | |
3223 | 3223 | | |
3224 | 3224 | | |
3225 | 3225 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5544 | 5544 | | |
5545 | 5545 | | |
5546 | 5546 | | |
| 5547 | + | |
| 5548 | + | |
| 5549 | + | |
| 5550 | + | |
| 5551 | + | |
| 5552 | + | |
| 5553 | + | |
| 5554 | + | |
| 5555 | + | |
| 5556 | + | |
| 5557 | + | |
| 5558 | + | |
| 5559 | + | |
| 5560 | + | |
| 5561 | + | |
| 5562 | + | |
| 5563 | + | |
| 5564 | + | |
| 5565 | + | |
| 5566 | + | |
| 5567 | + | |
| 5568 | + | |
| 5569 | + | |
| 5570 | + | |
| 5571 | + | |
| 5572 | + | |
| 5573 | + | |
0 commit comments