[hackers] [scc] [cc2-qbe] Check void type out of int and floats || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Tue, 24 Jan 2017 16:30:32 +0100 (CET)

commit 1685a71d45fc658f1a9793d78440ac85b79d60d0
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Tue Jan 24 16:28:33 2017 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_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
_AT_@ -310,7 +310,6 @@ size2stack(Type *tp)
 {
         if (tp->flags & INTF) {
                 switch (tp->size) {
- case 0:
                 case 1:
                 case 2:
                 case 4:
_AT_@ -323,6 +322,8 @@ size2stack(Type *tp)
                         return "s";
                 else if (tp->size == 8)
                         return "d";
+ } else if (tp->size == 0) {
+ return "w";
         }
         abort();
 }
Received on Tue Jan 24 2017 - 16:30:32 CET

This archive was generated by hypermail 2.3.0 : Tue Jan 24 2017 - 16:36:16 CET