diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-11-10 20:26:22 -0500 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-11-10 20:26:22 -0500 |
commit | 2deff35ded578b095a945864858ce635d8357ddc (patch) | |
tree | 7d7407f12be9ba13f5f1a12615110195717a7033 /lisc/ssa.c | |
parent | 9f1ecf974edba3678222605f8045d1a0730e0d92 (diff) | |
download | roux-2deff35ded578b095a945864858ce635d8357ddc.tar.gz |
add a few safeguards
Diffstat (limited to 'lisc/ssa.c')
-rw-r--r-- | lisc/ssa.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lisc/ssa.c b/lisc/ssa.c index 455b687..d58ce85 100644 --- 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) |