Commit 7029bde
Stop speculate from infinite looping in HHBBC
Summary:
If we optimize a block, HHBBC will then speculate to the next block,
seeing if we can replace the jump to the next block with a further
block. The logic was not taking into account that we might speculate
the same block recursively. If this happens (see attached test case
for simple example), then hhbbc will infinite loop. Prevent this by
keeping a "seen" set during speculating, and bailing out if we hit a
block we already hit.
Reviewed By: jano
Differential Revision: D93157056
fbshipit-source-id: 0888761b31f826e94c803d54f6eec04ca47b9edf1 parent bef5880 commit 7029bde
3 files changed
Lines changed: 20 additions & 2 deletions
File tree
- hphp
- hhbbc
- test/slow/hhbbc
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6406 | 6406 | | |
6407 | 6407 | | |
6408 | 6408 | | |
| 6409 | + | |
| 6410 | + | |
6409 | 6411 | | |
6410 | | - | |
| 6412 | + | |
6411 | 6413 | | |
6412 | 6414 | | |
6413 | 6415 | | |
| |||
6439 | 6441 | | |
6440 | 6442 | | |
6441 | 6443 | | |
6442 | | - | |
| 6444 | + | |
6443 | 6445 | | |
6444 | 6446 | | |
6445 | 6447 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments