From c948732efaf823f36d05608fe716bfcc4a98b70c Mon Sep 17 00:00:00 2001 From: "Pavlas, Zdenek" Date: Wed, 17 Aug 2016 06:12:11 -0700 Subject: [PATCH] x86_64/elf: only variadic calls need rax --- x86_64-gen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x86_64-gen.c b/x86_64-gen.c index 5a122d0f..ec613eb6 100644 --- a/x86_64-gen.c +++ b/x86_64-gen.c @@ -1441,7 +1441,8 @@ void gfunc_call(int nb_args) } } - oad(0xb8, nb_sse_args < 8 ? nb_sse_args : 8); /* mov nb_sse_args, %eax */ + if (vtop->type.ref->c != FUNC_NEW) /* implies FUNC_OLD or FUNC_ELLIPSIS */ + oad(0xb8, nb_sse_args < 8 ? nb_sse_args : 8); /* mov nb_sse_args, %eax */ gcall_or_jmp(0); if (args_size) gadd_sp(args_size); -- 2.11.4.GIT