commit 1685a71d45fc658f1a9793d78440ac85b79d60d0
parent 70500f1e134d44e3ca341a15f66447a8465346b0
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Tue, 24 Jan 2017 16:28:33 +0100
[cc2-qbe] Check void type out of int and floats
Voidtype hasn't any of the flags INTF or FLOATF,
so it was generating an abort()
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/cc2/arch/qbe/code.c b/cc2/arch/qbe/code.c
@@ -310,7 +310,6 @@ size2stack(Type *tp)
{
if (tp->flags & INTF) {
switch (tp->size) {
- case 0:
case 1:
case 2:
case 4:
@@ -323,6 +322,8 @@ size2stack(Type *tp)
return "s";
else if (tp->size == 8)
return "d";
+ } else if (tp->size == 0) {
+ return "w";
}
abort();
}