scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 30feebeac1f5fe74efaf305468fdc332e1b9ee0e
parent 312eb7b57fbe36785a175196ac218044c79123de
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu, 23 Feb 2017 09:27:32 +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

Diffstat:
Mcc1/arch/amd64-sysv/arch.c | 1+
Mcc1/arch/i386-sysv/arch.c | 1+
Mcc1/arch/qbe/arch.c | 1+
Mcc1/arch/z80/arch.c | 1+
4 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/cc1/arch/amd64-sysv/arch.c b/cc1/arch/amd64-sysv/arch.c @@ -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 @@ -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 @@ -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 @@ -39,6 +39,7 @@ static Type types[] = { .op = PTR, .letter = L_POINTER, .prop = TDEFINED, + .type = &types[5], /* char type */ .size = 2, .align = 2, },