[hackers] [scc] Fix valid_va_list || Quentin Rameau
commit 384068c0a86339bf69386b769cf9c6bad820c620
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:17:55 2017 +0100
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:53:29 CET
This archive was generated by hypermail 2.3.0
: Wed Feb 15 2017 - 13:00:21 CET