summary refs log tree commit diff
path: root/src/rt/arch
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-11-29 13:47:23 -0800
committerBrian Anderson <banderson@mozilla.com>2011-11-29 13:47:54 -0800
commitafb8f0174170cb9f23ec0b8a93f4bb8dd4514603 (patch)
treee037e6b867954238a38cdc79333f90c42079f395 /src/rt/arch
parent9675343dc975a0159d5f7b52e4a7f72737f0549c (diff)
downloadrust-afb8f0174170cb9f23ec0b8a93f4bb8dd4514603.tar.gz
rust-afb8f0174170cb9f23ec0b8a93f4bb8dd4514603.zip
rt: Fix calculation of stack args location in x86_64/morestack.S
Diffstat (limited to 'src/rt/arch')
-rw-r--r--src/rt/arch/x86_64/morestack.S7
1 files changed, 4 insertions, 3 deletions
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