[hackers] [scc] [cc1] Set base type of voidtype || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Thu, 23 Feb 2017 09:29:29 +0100 (CET)

commit 30feebeac1f5fe74efaf305468fdc332e1b9ee0e
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Thu Feb 23 09:27:32 2017 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Thu Feb 23 09:27:32 2017 +0100

    [cc1] Set base type of voidtype
    
    pvoidtype is a function that should be not dereferenced,
    but there is a few places in the code where it is to
    do some semantic tests, and having a pointer without
    base type is a bit dangerous

diff --git a/cc1/arch/amd64-sysv/arch.c b/cc1/arch/amd64-sysv/arch.c
index 2899034..ba5d7ea 100644
--- a/cc1/arch/amd64-sysv/arch.c
+++ b/cc1/arch/amd64-sysv/arch.c
_AT_@ -39,6 +39,7 @@ static Type types[] = {
                 .op = PTR,
                 .letter = L_POINTER,
                 .prop = TDEFINED,
+ .type = &types[5], /* chartype */
                 .size = 8,
                 .align = 8,
         },
diff --git a/cc1/arch/i386-sysv/arch.c b/cc1/arch/i386-sysv/arch.c
index 64ab6b2..fd73eba 100644
--- a/cc1/arch/i386-sysv/arch.c
+++ b/cc1/arch/i386-sysv/arch.c
_AT_@ -39,6 +39,7 @@ static Type types[] = {
                 .op = PTR,
                 .letter = L_POINTER,
                 .prop = TDEFINED,
+ .type = &types[5], /* chartype */
                 .size = 4,
                 .align = 4,
         },
diff --git a/cc1/arch/qbe/arch.c b/cc1/arch/qbe/arch.c
index 18852bf..01e2410 100644
--- a/cc1/arch/qbe/arch.c
+++ b/cc1/arch/qbe/arch.c
_AT_@ -39,6 +39,7 @@ static Type types[] = {
                 .op = PTR,
                 .letter = L_POINTER,
                 .prop = TDEFINED,
+ .type = &types[5], /* char type */
                 .size = 8,
                 .align = 8,
         },
diff --git a/cc1/arch/z80/arch.c b/cc1/arch/z80/arch.c
index f7b50b5..b5e31f3 100644
--- a/cc1/arch/z80/arch.c
+++ b/cc1/arch/z80/arch.c
_AT_@ -39,6 +39,7 @@ static Type types[] = {
                 .op = PTR,
                 .letter = L_POINTER,
                 .prop = TDEFINED,
+ .type = &types[5], /* char type */
                 .size = 2,
                 .align = 2,
         },
Received on Thu Feb 23 2017 - 09:29:29 CET

This archive was generated by hypermail 2.3.0 : Thu Feb 23 2017 - 09:36:22 CET