Skip to content

Commit 597e276

Browse files
committed
---
yaml --- r: 6484 b: refs/heads/master c: ef20afc h: refs/heads/master v: v3
1 parent 027f745 commit 597e276

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 4dcb0ee0ce0c48fa2328c9c88dbbe19614cdc545
2+
refs/heads/master: ef20afc36ca7083c910fa05ea28576fe4b465783

trunk/src/rt/arch/x86_64/morestack.S

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
.type MORESTACK,@function
4949
#endif
5050

51+
#if defined(__linux)
5152
MORESTACK:
5253
.cfi_startproc
5354

@@ -71,19 +72,23 @@ MORESTACK:
7172
addq $16, %rcx // Add the saved %rbp, and return address
7273
addq %r11, %rcx // Add the size of stack arguments
7374

74-
pushq %r10 // The amount of stack needed
75-
pushq %rcx // Address of stack arguments
76-
pushq %r11 // Size of stack arguments
7775
pushq %rbp // Save the Rust stack pointer
76+
pushq %r11 // Size of stack arguments
77+
pushq %rcx // Address of stack arguments
78+
pushq %r10 // The amount of stack needed
7879

7980
// FIXME: Don't understand why I have to use the PLT here
8081
lea RUST_NEW_STACK2@PLT(%rip), %rsi
81-
lea 24(%rsp), %rdi
82+
mov %rsp, %rdi
8283
call UPCALL_CALL_C@PLT
8384

8485
mov (%rsp),%rdx // Grab the return pointer.
8586
inc %rdx // Skip past the `ret`.
8687
mov %rax,%rsp // Switch to the new stack.
8788
call *%rdx // Enter the new function.
8889

89-
.cfi_endproc
90+
.cfi_endproc
91+
#else
92+
MORESTACK:
93+
ret
94+
#endif

0 commit comments

Comments
 (0)