From afb8f0174170cb9f23ec0b8a93f4bb8dd4514603 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 29 Nov 2011 13:47:23 -0800 Subject: rt: Fix calculation of stack args location in x86_64/morestack.S --- src/rt/arch/x86_64/morestack.S | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/rt') diff --git a/src/rt/arch/x86_64/morestack.S b/src/rt/arch/x86_64/morestack.S index 25b3fa3ec69..7a17cb6744e 100644 --- a/src/rt/arch/x86_64/morestack.S +++ b/src/rt/arch/x86_64/morestack.S @@ -76,10 +76,11 @@ MORESTACK: pushq %r8 pushq %r9 - // Calculate the address of the stack arguments + // Calculate the address of the stack arguments. + // We have the base pointer, __morestack's return address, + // and __morestack's caller's return address to skip movq %rbp, %rcx - addq $16, %rcx // Add the saved %rbp, and return address - addq %r11, %rcx // Add the size of stack arguments + addq $24, %rcx // Base pointer, return address x2 pushq %rbp // Save the Rust stack pointer pushq %r11 // Size of stack arguments -- cgit 1.4.1-3-g733a5