From: Klaus Treichel Date: Wed, 10 Dec 2008 17:36:51 +0000 (+0000) Subject: Fix calls to variadic functions. X-Git-Tag: before.move.to.git~50 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=0c9ed44ad3b3b7f4e3d179d27a524939b635e8c1;p=francis%2Flibjit.git Fix calls to variadic functions. --- diff --git a/ChangeLog b/ChangeLog index 97055d3..3b1179e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-12-10 Klaus Treichel + + * jit/jit-rules-x86-64.c (x86_64_call_code): Load %rax with 8 before + doing the call for calls to variadic functions. + + * jit/jit-rules-x86-64.ins (JIT_OP_CALL_INDIRECT, + JIT_OP_CALL_VTABLE_PTR): likewise. + 2008-12-10 Aleksey Demakov * NEWS: update news for the 0.1.2 release diff --git a/jit/jit-rules-x86-64.c b/jit/jit-rules-x86-64.c index e514f7e..4eab821 100644 --- a/jit/jit-rules-x86-64.c +++ b/jit/jit-rules-x86-64.c @@ -823,6 +823,7 @@ x86_64_call_code(unsigned char *inst, jit_nint func) { jit_nint offset; + x86_64_mov_reg_imm_size(inst, X86_64_RAX, 8, 4); offset = func - ((jit_nint)inst + 5); if(offset >= jit_min_int && offset <= jit_max_int) { diff --git a/jit/jit-rules-x86-64.ins b/jit/jit-rules-x86-64.ins index 6ab132e..168bec1 100644 --- a/jit/jit-rules-x86-64.ins +++ b/jit/jit-rules-x86-64.ins @@ -2920,6 +2920,7 @@ JIT_OP_CALL_TAIL: JIT_OP_CALL_INDIRECT: [] -> { + x86_64_mov_reg_imm_size(inst, X86_64_RAX, 8, 4); x86_64_call_reg(inst, X86_64_SCRATCH); } @@ -2932,6 +2933,7 @@ JIT_OP_CALL_INDIRECT_TAIL: JIT_OP_CALL_VTABLE_PTR: [] -> { + x86_64_mov_reg_imm_size(inst, X86_64_RAX, 8, 4); x86_64_call_reg(inst, X86_64_SCRATCH); }