]> git.lizzy.rs Git - rust.git/commitdiff
rt: Use %ecx instead of %eax during the second half of __morestack
authorBrian Anderson <banderson@mozilla.com>
Wed, 14 Dec 2011 02:26:56 +0000 (18:26 -0800)
committerBrian Anderson <banderson@mozilla.com>
Wed, 14 Dec 2011 02:26:56 +0000 (18:26 -0800)
If Rust code made use of return values then using %eax here would clobber it

src/rt/arch/i386/morestack.S

index d1c255015c3751b92877b57f2a45ebc4495fe44e..1a076b6a3ba8f14a34573b412984ae0e50546e0d 100644 (file)
@@ -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