summary refs log tree commit diff
path: root/lisc
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-03-18 14:44:20 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-03-18 15:15:02 -0400
commitb19b9a27a0efa7d46eda31d0bb81ade955d80e99 (patch)
tree49b75edf977ea10135e7d1f7f840fa1c96a0b8ab /lisc
parentd1c6c305f7244775541c3ba6e0422e9a0bb5d521 (diff)
downloadroux-b19b9a27a0efa7d46eda31d0bb81ade955d80e99.tar.gz
handle padding correctly in types
Diffstat (limited to 'lisc')
-rw-r--r--lisc/isel.c8
-rw-r--r--lisc/lisc.h5
-rw-r--r--lisc/parse.c5
3 files changed, 12 insertions, 6 deletions
diff --git a/lisc/isel.c b/lisc/isel.c
index f6d877c..e853f7b 100644
--- a/lisc/isel.c
+++ b/lisc/isel.c
@@ -395,10 +395,14 @@ aclass(AClass *a, Typ *t)
 	for (e=0, s=0; e<2; e++) {
 		cls = -1;
 		for (n=0; n<8 && t->seg[s].len; s++) {
-			if (t->seg[s].flt) {
+			if (t->seg[s].ispad) {
+				/* don't change anything */
+			}
+			else if (t->seg[s].isflt) {
 				if (cls == -1)
 					cls = Kd;
-			} else
+			}
+			else
 				cls = Kl;
 			n += t->seg[s].len;
 		}
diff --git a/lisc/lisc.h b/lisc/lisc.h
index c730b1f..c6405ca 100644
--- a/lisc/lisc.h
+++ b/lisc/lisc.h
@@ -435,8 +435,9 @@ struct Typ {
 	int align;
 
 	struct {
-		uint flt:1;
-		uint len:31;
+		uint isflt:1;
+		uint ispad:1;
+		uint len:30;
 	} seg[NSeg+1];
 };
 
diff --git a/lisc/parse.c b/lisc/parse.c
index 43787c2..bf509d1 100644
--- a/lisc/parse.c
+++ b/lisc/parse.c
@@ -745,7 +745,7 @@ parsetyp()
 				a = s - a;
 				if (++n < NSeg) {
 					/* padding segment */
-					ty->seg[n].flt = 0;
+					ty->seg[n].ispad = 1;
 					ty->seg[n].len = a;
 				}
 			}
@@ -757,7 +757,8 @@ parsetyp()
 				c = 1;
 			while (c-- > 0) {
 				if (++n < NSeg) {
-					ty->seg[n].flt = flt;
+					ty->seg[n].isflt = flt;
+					ty->seg[n].ispad = 0;
 					ty->seg[n].len = s;
 				}
 				sz += a + s;