commit 1685a71d45fc658f1a9793d78440ac85b79d60d0
Author:     Roberto E. Vargas Caballero <k...@shike2.com>
AuthorDate: Tue Jan 24 16:28:33 2017 +0100
Commit:     Roberto E. Vargas Caballero <k...@shike2.com>
CommitDate: Tue Jan 24 16:28:33 2017 +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()

diff --git a/cc2/arch/qbe/code.c b/cc2/arch/qbe/code.c
index bca8020..8e2c0a9 100644
--- 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();
 }

Reply via email to