aboutsummaryrefslogtreecommitdiff
path: root/src/rt/rust_task.cpp
diff options
context:
space:
mode:
authorRoy Frostig <[email protected]>2010-07-12 23:58:00 -0700
committerRoy Frostig <[email protected]>2010-07-15 12:30:46 -0700
commit7c8c98a6d7fe02ee697d8490a7203d1da676d908 (patch)
treea5c8e952168c086e7eb36010fceef6836f278d3c /src/rt/rust_task.cpp
parentBegin moving closure-or-obj pointer out to front of call args by changing the... (diff)
downloadrust-7c8c98a6d7fe02ee697d8490a7203d1da676d908.tar.xz
rust-7c8c98a6d7fe02ee697d8490a7203d1da676d908.zip
Adjust call args laid out by fake frame created in rust_task::start to reflect new position of closure-or-obj pointer.
Diffstat (limited to 'src/rt/rust_task.cpp')
-rw-r--r--src/rt/rust_task.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index 43213b46..7c92c4ca 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -130,6 +130,7 @@ rust_task::start(uintptr_t exit_task_glue,
uintptr_t *spp = (uintptr_t *)rust_sp;
// The exit_task_glue frame we synthesize above the frame we activate:
+ *spp-- = (uintptr_t) 0; // closure-or-obj
*spp-- = (uintptr_t) this; // task
*spp-- = (uintptr_t) 0; // output
*spp-- = (uintptr_t) 0; // retpc
@@ -153,6 +154,7 @@ rust_task::start(uintptr_t exit_task_glue,
uintptr_t *src = (uintptr_t *)args;
src += 1; // spawn-call output slot
src += 1; // spawn-call task slot
+ src += 1; // spawn-call closure-or-obj slot
// Memcpy all but the task and output pointers
callsz -= (2 * sizeof(uintptr_t));
spp = (uintptr_t*) (((uintptr_t)spp) - callsz);
@@ -168,6 +170,7 @@ rust_task::start(uintptr_t exit_task_glue,
// The *implicit* incoming args to the spawnee frame we're
// activating:
+ *spp-- = (uintptr_t) 0; // closure-or-obj
*spp-- = (uintptr_t) this; // task
*spp-- = (uintptr_t) 0; // output addr
*spp-- = (uintptr_t) exit_task_glue; // retpc