summary refs log tree commit diff
path: root/lisc
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-03-22 12:16:03 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-03-22 12:16:09 -0400
commita67ffa423cc859ac5093337e26af9c87af4631f6 (patch)
tree3f136f899f59ee2a465f9c8c57d3a143a6a7f226 /lisc
parent337b10f6edc4d56cbf126255b3e63e6e0b7c8530 (diff)
downloadroux-a67ffa423cc859ac5093337e26af9c87af4631f6.tar.gz
check for overflow in ssa.c (abi fuzzer)
Diffstat (limited to 'lisc')
-rw-r--r--lisc/lisc.h2
-rw-r--r--lisc/ssa.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/lisc/lisc.h b/lisc/lisc.h
index 41be0ad..a57a984 100644
--- a/lisc/lisc.h
+++ b/lisc/lisc.h
@@ -77,7 +77,7 @@ enum Reg {
 
 enum {
 	NString = 32,
-	NPred   = 15,
+	NPred   = 63,
 	NIns    = 8192,
 	NAlign  = 3,
 	NSeg    = 32,
diff --git a/lisc/ssa.c b/lisc/ssa.c
index 269406b..7ccd944 100644
--- a/lisc/ssa.c
+++ b/lisc/ssa.c
@@ -464,6 +464,8 @@ renblk(Blk *b, Name **stk, Fn *fn)
 			t = p->to.val;
 			if ((t=fn->tmp[t].visit)) {
 				m = p->narg++;
+				if (m == NPred)
+					diag("ssa: too many phi arguments");
 				p->arg[m] = getstk(t, b, stk);
 				p->blk[m] = b;
 			}