Repository navigation
Commit f936452
committed
Keep only the conditional expressions both passes derived when widening a loop scope
generalizeWith() widened changing variables but kept every holder of the
new pass, so a holder whose types grew by one literal per pass (`if
$save_item_flag=0 then $items_c is 1|2|...|n` in nested while loops with
counters) kept the loop changing until the iteration limit, and every
variable it writes became mixed. Intersecting with the previous pass's
holders drops the ones still changing; the set can only shrink, so it
converges.
Amp-Thread-ID: https://ampcode.com/threads/T-01a21c26-db20-7349-9bc4-d608e06a112b1 parent f19dab4 commit f936452
3 files changed
Lines changed: 25 additions & 5 deletions
File tree
- src/Analyser
- tests/PHPStan/Analyser/nsrt
- turbo-ext/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5059 | 5059 | | |
5060 | 5060 | | |
5061 | 5061 | | |
5062 | | - | |
| 5062 | + | |
5063 | 5063 | | |
5064 | 5064 | | |
5065 | 5065 | | |
| |||
5078 | 5078 | | |
5079 | 5079 | | |
5080 | 5080 | | |
5081 | | - | |
| 5081 | + | |
| 5082 | + | |
| 5083 | + | |
| 5084 | + | |
5082 | 5085 | | |
5083 | 5086 | | |
5084 | 5087 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
59 | 74 | | |
60 | 75 | | |
61 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9440 | 9440 | | |
9441 | 9441 | | |
9442 | 9442 | | |
9443 | | - | |
| 9443 | + | |
9444 | 9444 | | |
9445 | | - | |
9446 | | - | |
| 9445 | + | |
| 9446 | + | |
| 9447 | + | |
| 9448 | + | |
9447 | 9449 | | |
9448 | 9450 | | |
9449 | 9451 | | |
| |||
0 commit comments