Commit 5e981c5
committed
refcount_insertion: fix use-after-realloc in updateInState + guard
Bug python#14: phx_rc_env_block_state reallocs block_states array,
invalidating pred state pointers from collectPredStates.
Fix: allocate current block's state BEFORE collecting pred pointers.
Also add NULL/empty guard in initializeInState for predecessors
whose out-state hasn't been populated yet (backedge case).
Found via ASAN: heap-use-after-free in phx_sm_get called from
phx_rc_initialize_in_state. match/case pattern matching now compiles.1 parent 9f44b20 commit 5e981c5
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
| 464 | + | |
464 | 465 | | |
465 | 466 | | |
466 | 467 | | |
| |||
566 | 567 | | |
567 | 568 | | |
568 | 569 | | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
569 | 574 | | |
570 | 575 | | |
571 | 576 | | |
572 | | - | |
| 577 | + | |
| 578 | + | |
573 | 579 | | |
574 | 580 | | |
575 | 581 | | |
| |||
0 commit comments