[hackers] [scc] [cc1] Fix valid_va_list || Quentin Rameau

From: <git_AT_suckless.org>
Date: Wed, 15 Feb 2017 12:57:48 +0100 (CET)

commit 9f519ebee29edca444e31fb8f01348f35252a754
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Wed Feb 15 11:55:24 2017 +0100
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Wed Feb 15 12:58:41 2017 +0100

    [cc1] Fix valid_va_list
    
    Directly comparing objects via pointers is too strict and the check
    would fail for typedefs.

diff --git a/cc1/arch/amd64-sysv/arch.c b/cc1/arch/amd64-sysv/arch.c
index 89bec2d..2899034 100644
--- a/cc1/arch/amd64-sysv/arch.c
+++ b/cc1/arch/amd64-sysv/arch.c
_AT_@ -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
index 6420002..64ab6b2 100644
--- a/cc1/arch/i386-sysv/arch.c
+++ b/cc1/arch/i386-sysv/arch.c
_AT_@ -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
index 3835ed1..18852bf 100644
--- a/cc1/arch/qbe/arch.c
+++ b/cc1/arch/qbe/arch.c
_AT_@ -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
index 70aec61..f7b50b5 100644
--- a/cc1/arch/z80/arch.c
+++ b/cc1/arch/z80/arch.c
_AT_@ -217,5 +217,5 @@ iarch(void)
 int
 valid_va_list(Type *tp)
 {
- return tp == va_list_type;
+ return eqtype(tp, va_list_type, 1);
 }
Received on Wed Feb 15 2017 - 12:57:48 CET

This archive was generated by hypermail 2.3.0 : Wed Feb 15 2017 - 13:00:25 CET