File tree 2 files changed +9
-3
lines changed
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -198,11 +198,17 @@ MORESTACK:
198
198
// Realign stack - remember that __morestack was called misaligned
199
199
subl $12 , %esp
200
200
201
+ // Save the return value of the function we allocated space for
202
+ movl %eax , (%esp )
203
+
201
204
// Now that we're on the return path we want to avoid
202
205
// stomping on %eax. FIXME: Need to save and restore %eax to
203
206
// actually preserve it across the call to delete the stack
204
207
call UPCALL_DEL_STACK
205
208
209
+ // And restore it
210
+ movl (%esp ), %eax
211
+
206
212
addl $12 ,%esp
207
213
208
214
popl %ebp
Original file line number Diff line number Diff line change @@ -100,8 +100,8 @@ MORESTACK:
100
100
// Switch back to the rust stack
101
101
movq %rbp , %rsp
102
102
103
- // Align the stack again
104
- pushq $0
103
+ // Save the return value
104
+ pushq %rax
105
105
106
106
// FIXME: Should preserve %rax here
107
107
#ifdef __APPLE__
@@ -111,7 +111,7 @@ MORESTACK:
111
111
call UPCALL_DEL_STACK@PLT
112
112
#endif
113
113
114
- addq $8 , %rsp
114
+ popq %rax // Restore the return value
115
115
popq %rbp
116
116
// FIXME: I don't think these rules are necessary
117
117
// since the unwinder should never encounter an instruction
You can’t perform that action at this time.
0 commit comments