]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
Fix calls to variadic functions.
authorKlaus Treichel <ktreichel@web.de>
Wed, 10 Dec 2008 17:36:51 +0000 (17:36 +0000)
committerKlaus Treichel <ktreichel@web.de>
Wed, 10 Dec 2008 17:36:51 +0000 (17:36 +0000)
ChangeLog
jit/jit-rules-x86-64.c
jit/jit-rules-x86-64.ins

index 97055d31a82a8a4cbdef7e6f53106b6b503fabed..3b1179e6b508ce28dc2fd995311d00942415e3b1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-12-10  Klaus Treichel  <ktreichel@web.de>
+
+       * 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  <ademakov@gmail.com>
 
        * NEWS: update news for the 0.1.2 release
index e514f7eab8fcaa6e4d2502cd59009a8cb8a64a19..4eab8210e8319b1517a769d3621665d0f3dc68b0 100644 (file)
@@ -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)
        {
index 6ab132ecad22062f7c30550bb614f70af0a38e79..168bec1767e405c1387d33643988d2f5751e71b8 100644 (file)
@@ -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);
        }