From f332643e7fef96f15db675dd50bf643199d8f6a5 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 13 Dec 2011 18:26:56 -0800 Subject: [PATCH] rt: Use %ecx instead of %eax during the second half of __morestack If Rust code made use of return values then using %eax here would clobber it --- src/rt/arch/i386/morestack.S | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/rt/arch/i386/morestack.S b/src/rt/arch/i386/morestack.S index d1c255015c37..1a076b6a3ba8 100644 --- a/src/rt/arch/i386/morestack.S +++ b/src/rt/arch/i386/morestack.S @@ -122,11 +122,13 @@ MORESTACK: subl $8, %esp // Alignment + // Now that we're on the return path we want to avoid + // stomping on %eax #ifdef __APPLE__ call 1f -1: popl %eax - movl L_upcall_del_stack$non_lazy_ptr-1b(%eax),%eax - pushl %eax +1: popl %ecx + movl L_upcall_del_stack$non_lazy_ptr-1b(%ecx),%ecx + pushl %ecx #else pushl $UPCALL_DEL_STACK #endif