From b6b8a9f7b8347a55c442b2210b8bcee353ef7384 Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Wed, 8 Nov 2017 14:10:48 -0500 Subject: [PATCH] Fix Win64 calling convention --- src/interpreter-stacktrace.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/interpreter-stacktrace.c b/src/interpreter-stacktrace.c index a7c2ec34905af..0d61807854091 100644 --- a/src/interpreter-stacktrace.c +++ b/src/interpreter-stacktrace.c @@ -86,14 +86,14 @@ asm( "\tsubq $" XSTR(MAX_INTERP_STATE_SIZE) " + " XSTR(STACK_PADDING)", %rsp\n" ".cfi_def_cfa_offset " XSTR(MAX_INTERP_STATE_SIZE) " + " XSTR(STACK_PADDING)" + 8\n" #ifdef _OS_WINDOWS_ - "\tmovq %rcx, %rax\n" - "\tleaq " XSTR(STACK_PADDING) "(%rsp), %rcx\n" +#define ARG1_REG "rcx" #else - "\tmovq %rdi, %rax\n" - "\tleaq " XSTR(STACK_PADDING) "(%rsp), %rdi\n" +#define ARG1_REG "rdi" #endif + "\tmovq %" ARG1_REG ", %rax\n" + "\tleaq " XSTR(STACK_PADDING) "(%rsp), %" ARG1_REG "\n" // Zero out the src field - "\tmovq $0, 0(%rdi)\n" + "\tmovq $0, 0(%" ARG1_REG ")\n" #ifdef _OS_WINDOWS_ // Make space for the register parameter area "\tsubq $32, %rsp\n" @@ -120,10 +120,10 @@ asm( #elif defined(_CPU_X86_) #define MAX_INTERP_STATE_SIZE 36 -#ifndef _OS_WINDOWS_ -#define STACK_PADDING 8 -#else +#ifdef _OS_WINDOWS_ #define STACK_PADDING 4 +#else +#define STACK_PADDING 8 #endif size_t TOTAL_STACK_PADDING = STACK_PADDING;