summary refs log tree commit diff
path: root/ssa.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-04-18 14:03:06 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-04-18 14:03:06 -0400
commitc43a07086bdeefe029c5b6da4ec1c8020126d5ca (patch)
treed497b43234d5d59ca40ceb22154d24e15fdeb395 /ssa.c
parentc6f3adc52d375d434e3dfd2d23056f0bfdbcdc67 (diff)
downloadroux-c43a07086bdeefe029c5b6da4ec1c8020126d5ca.tar.gz
factor some subtyping logic in clsmerge()
Diffstat (limited to 'ssa.c')
-rw-r--r--ssa.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ssa.c b/ssa.c
index c35fd7e..e5f0f44 100644
--- a/ssa.c
+++ b/ssa.c
@@ -288,7 +288,8 @@ phiins(Fn *fn)
 	Ins *i;
 	Phi *p;
 	Ref r;
-	int t, n, k, nt;
+	int t, n, nt;
+	short k;
 
 	bsinit(u, fn->nblk);
 	bsinit(defs, fn->nblk);
@@ -324,9 +325,8 @@ phiins(Fn *fn)
 							bsset(u, b->id);
 							*--bp = b;
 						}
-						if (k == -1)
-							k = i->cls;
-						assert(k == i->cls);
+						if (clsmerge(&k, i->cls))
+							die("invalid input");
 					}
 				}
 			}