qbe

Internal scc patchset buffer for QBE
Log | Files | Refs | README | LICENSE

commit 2deff35ded578b095a945864858ce635d8357ddc
parent 9f1ecf974edba3678222605f8045d1a0730e0d92
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date:   Tue, 10 Nov 2015 20:26:22 -0500

add a few safeguards

Diffstat:
Mlisc/ssa.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisc/ssa.c b/lisc/ssa.c @@ -105,8 +105,10 @@ inter(Blk *b1, Blk *b2) b1 = b2; b2 = bt; } - while (b1->id > b2->id) + while (b1->id > b2->id) { b1 = b1->idom; + assert(b1); + } } return b1; } @@ -149,6 +151,7 @@ filldom(Fn *fn) static int sdom(Blk *b1, Blk *b2) { + assert(b1 && b2); if (b1 == b2) return 0; while (b2->id > b1->id)