scc

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

commit 9f519ebee29edca444e31fb8f01348f35252a754
parent 661bc252516e229e3f3769956b1b16c8d40a95eb
Author: Quentin Rameau <quinq@fifth.space>
Date:   Wed, 15 Feb 2017 11:55:24 +0100

[cc1] Fix valid_va_list

Directly comparing objects via pointers is too strict and the check
would fail for typedefs.

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

diff --git a/cc1/arch/amd64-sysv/arch.c b/cc1/arch/amd64-sysv/arch.c @@ -218,5 +218,5 @@ iarch(void) int valid_va_list(Type *tp) { - return tp->op == PTR && tp->type == va_type; + return tp->op == PTR && eqtype(tp->type, va_type, 1); } diff --git a/cc1/arch/i386-sysv/arch.c b/cc1/arch/i386-sysv/arch.c @@ -219,5 +219,5 @@ iarch(void) int valid_va_list(Type *tp) { - return tp == va_list_type; + return eqtype(tp, va_list_type, 1); } diff --git a/cc1/arch/qbe/arch.c b/cc1/arch/qbe/arch.c @@ -218,5 +218,5 @@ iarch(void) int valid_va_list(Type *tp) { - return tp->op == PTR && tp->type == va_type; + return tp->op == PTR && eqtype(tp->type, va_type, 1); } diff --git a/cc1/arch/z80/arch.c b/cc1/arch/z80/arch.c @@ -217,5 +217,5 @@ iarch(void) int valid_va_list(Type *tp) { - return tp == va_list_type; + return eqtype(tp, va_list_type, 1); }