aboutsummaryrefslogtreecommitdiff
path: root/targ.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2021-09-06 17:08:18 -0700
committerMichael Forney <mforney@mforney.org>2021-09-06 17:08:18 -0700
commit8f9714c3713f4060de4706e099b745d5d4e5ba1f (patch)
tree0e6b019927bfcab6b1d321847e7f1b9cb8495b6e /targ.c
parent34ae0d48e9669687003c26f94e07fa00d12dd41f (diff)
Fix type-checking of va_list arguments to varargs built-ins
If the argument was a function parameter, its type has already been adjusted. So on x86_64, we can't just ignore the automatic array-to-pointer conversion, since it was never a pointer to begin with. Instead, keep track of the adjusted va_list type, and check that the arguments to varargs built-ins match that type.
Diffstat (limited to 'targ.c')
-rw-r--r--targ.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/targ.c b/targ.c
index f2be127..6e89c51 100644
--- a/targ.c
+++ b/targ.c
@@ -55,4 +55,5 @@ targinit(const char *name)
if (!targ)
fatal("unknown target '%s'", name);
typechar.basic.issigned = targ->signedchar;
+ typeadjvalist = typeadjust(targ->typevalist);
}