@@ -150,8 +150,8 @@ rust_task::start(uintptr_t exit_task_glue,
150
150
rust_sp -= sizeof (uintptr_t );
151
151
152
152
// NB: Darwin needs "16-byte aligned" stacks *at the point of the call
153
- // instruction in the caller*. This means that the address at which a
154
- // retpc is pushed must always be 16-byte aligned.
153
+ // instruction in the caller*. This means that the address at which the
154
+ // word before retpc is pushed must always be 16-byte aligned.
155
155
//
156
156
// see: "Mac OS X ABI Function Call Guide"
157
157
@@ -168,11 +168,11 @@ rust_task::start(uintptr_t exit_task_glue,
168
168
169
169
170
170
// The exit_task_glue frame we synthesize above the frame we activate:
171
- make_aligned_room_for_bytes (spp, 3 * sizeof (uintptr_t ));
171
+ make_aligned_room_for_bytes (spp, 2 * sizeof (uintptr_t ));
172
172
*spp-- = (uintptr_t ) 0 ; // closure-or-obj
173
173
*spp-- = (uintptr_t ) this ; // task
174
- *spp-- = (uintptr_t ) 0x0 ; // output
175
174
I (dom, spp == align_down (spp));
175
+ *spp-- = (uintptr_t ) 0x0 ; // output
176
176
*spp-- = (uintptr_t ) 0x0 ; // retpc
177
177
178
178
uintptr_t exit_task_frame_base;
@@ -198,9 +198,9 @@ rust_task::start(uintptr_t exit_task_glue,
198
198
199
199
I (dom, args);
200
200
if (spawnee_abi == ABI_X86_RUSTBOOT_CDECL)
201
- make_aligned_room_for_bytes (spp, callsz);
201
+ make_aligned_room_for_bytes (spp, callsz - sizeof ( uintptr_t ) );
202
202
else
203
- make_aligned_room_for_bytes (spp, callsz - 2 * sizeof (uintptr_t ));
203
+ make_aligned_room_for_bytes (spp, callsz - 3 * sizeof (uintptr_t ));
204
204
205
205
// Copy args from spawner to spawnee.
206
206
uintptr_t *src = (uintptr_t *)args;
@@ -233,7 +233,7 @@ rust_task::start(uintptr_t exit_task_glue,
233
233
I (dom, spawnee_abi == ABI_X86_RUSTC_FASTCALL);
234
234
}
235
235
236
- I (dom, spp == align_down (spp));
236
+ I (dom, spp+ 1 == align_down (spp+ 1 ));
237
237
*spp-- = (uintptr_t ) exit_task_glue; // retpc
238
238
239
239
// The context the activate_glue needs to switch stack.
0 commit comments