mirror of
git://c9x.me/qbe.git
synced 2026-04-05 18:09:47 +00:00
fix bug in jumps simplification
In presence of jump loops, the algorithm would create cycles in the disjoint-set data structure. This caused infinite recursion and stack overflows.
This commit is contained in:
parent
2b64b75c84
commit
ae80e4f7ca
7
cfg.c
7
cfg.c
@ -304,8 +304,11 @@ simpljmp(Fn *fn)
|
|||||||
for (b=fn->start; b; b=b->link) {
|
for (b=fn->start; b; b=b->link) {
|
||||||
assert(!b->phi);
|
assert(!b->phi);
|
||||||
if (b->nins == 0)
|
if (b->nins == 0)
|
||||||
if (b->jmp.type == Jjmp)
|
if (b->jmp.type == Jjmp) {
|
||||||
uf[b->id] = b->s1;
|
uffind(&b->s1, uf);
|
||||||
|
if (b->s1 != b)
|
||||||
|
uf[b->id] = b->s1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (b=fn->start; b; b=b->link) {
|
for (b=fn->start; b; b=b->link) {
|
||||||
if (b->s1)
|
if (b->s1)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user