Add type arg to win va_block_arg_builtin.  Use pointer in arg_area for longer aggregates.
@@ -131,12 +131,11 @@ void *va_arg_builtin (void *p, uint64_t t) {
return a;
}
-void va_block_arg_builtin (void *res, void *p, size_t s) {
+void va_block_arg_builtin (void *res, void *p, size_t s, uint64_t t) {
struct x86_64_va_list *va = p;
- void *a = va->arg_area;
+ void *a = s <= 8 ? va->arg_area : *(void **) va->arg_area; /* pass by pointer */
memcpy (res, a, s);
- va->arg_area += (s + sizeof (uint64_t) - 1) / sizeof (uint64_t);
- return a;
+ va->arg_area++;
}
void va_start_interp_builtin (MIR_context_t ctx, void *p, void *a) {
