diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2011-03-30 14:10:06 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2011-03-30 14:10:06 -0700 |
| commit | a154c5b656ea215f136a6f4c3120b315686f4bc5 (patch) | |
| tree | f2887f040b335f6dcfff931d496db7661b23c2a5 /src/rt/rust_task.cpp | |
| parent | 3e7b991d4957a13e8049c1a4d1893a685f47d9ae (diff) | |
| download | rust-a154c5b656ea215f136a6f4c3120b315686f4bc5.tar.gz rust-a154c5b656ea215f136a6f4c3120b315686f4bc5.zip | |
Um, that'd be, align the word *before* retpc. Addresses point to the low part of a word. Un-XFAIL nbody on Darwin.
Diffstat (limited to 'src/rt/rust_task.cpp')
| -rw-r--r-- | src/rt/rust_task.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index febfd85162c..df7dd2a3531 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -150,8 +150,8 @@ rust_task::start(uintptr_t exit_task_glue, rust_sp -= sizeof(uintptr_t); // NB: Darwin needs "16-byte aligned" stacks *at the point of the call - // instruction in the caller*. This means that the address at which a - // retpc is pushed must always be 16-byte aligned. + // instruction in the caller*. This means that the address at which the + // word before retpc is pushed must always be 16-byte aligned. // // see: "Mac OS X ABI Function Call Guide" @@ -168,11 +168,11 @@ rust_task::start(uintptr_t exit_task_glue, // The exit_task_glue frame we synthesize above the frame we activate: - make_aligned_room_for_bytes(spp, 3 * sizeof(uintptr_t)); + make_aligned_room_for_bytes(spp, 2 * sizeof(uintptr_t)); *spp-- = (uintptr_t) 0; // closure-or-obj *spp-- = (uintptr_t) this; // task - *spp-- = (uintptr_t) 0x0; // output I(dom, spp == align_down(spp)); + *spp-- = (uintptr_t) 0x0; // output *spp-- = (uintptr_t) 0x0; // retpc uintptr_t exit_task_frame_base; @@ -198,9 +198,9 @@ rust_task::start(uintptr_t exit_task_glue, I(dom, args); if (spawnee_abi == ABI_X86_RUSTBOOT_CDECL) - make_aligned_room_for_bytes(spp, callsz); + make_aligned_room_for_bytes(spp, callsz - sizeof(uintptr_t)); else - make_aligned_room_for_bytes(spp, callsz - 2 * sizeof(uintptr_t)); + make_aligned_room_for_bytes(spp, callsz - 3 * sizeof(uintptr_t)); // Copy args from spawner to spawnee. uintptr_t *src = (uintptr_t *)args; @@ -233,7 +233,7 @@ rust_task::start(uintptr_t exit_task_glue, I(dom, spawnee_abi == ABI_X86_RUSTC_FASTCALL); } - I(dom, spp == align_down(spp)); + I(dom, spp+1 == align_down(spp+1)); *spp-- = (uintptr_t) exit_task_glue; // retpc // The context the activate_glue needs to switch stack. |
