Working on 2 argument spawn. The arguments seem to be copied correctly once, but then they get lost.
This commit is contained in:
parent
bb4c7a9c68
commit
dad426419c
3 changed files with 22 additions and 5 deletions
|
@ -5882,9 +5882,7 @@ fn trans_spawn(&@block_ctxt cx,
|
|||
e));
|
||||
}
|
||||
|
||||
// Make the tuple. We have to reverse the types first though.
|
||||
//vec::reverse[ty::t](arg_tys);
|
||||
//vec::reverse[ValueRef](arg_vals);
|
||||
// Make the tuple.
|
||||
auto args_ty = ty::mk_imm_tup(cx.fcx.lcx.ccx.tcx, arg_tys);
|
||||
|
||||
// Allocate and fill the tuple.
|
||||
|
|
|
@ -171,7 +171,12 @@ rust_task::start(uintptr_t spawnee_fn,
|
|||
src += 1; // spawn-call task slot
|
||||
src += 1; // spawn-call closure-or-obj slot
|
||||
|
||||
*spp-- = (uintptr_t) *src; // vec
|
||||
spp -= (args_size / sizeof(uintptr_t)) - 1;
|
||||
memmove(spp, src, args_size);
|
||||
spp--;
|
||||
|
||||
//*spp-- = (uintptr_t) *src; // vec
|
||||
|
||||
*spp-- = (uintptr_t) 0x0; // closure-or-obj
|
||||
*spp-- = (uintptr_t) this; // task
|
||||
*spp-- = (uintptr_t) dummy_ret; // output address
|
||||
|
@ -179,7 +184,6 @@ rust_task::start(uintptr_t spawnee_fn,
|
|||
I(dom, spp == align_down(spp));
|
||||
*spp-- = (uintptr_t) (uintptr_t) spawnee_fn;
|
||||
|
||||
|
||||
*spp-- = (uintptr_t) 0x0; // retp
|
||||
|
||||
*spp-- = (uintptr_t) rust_new_exit_task_glue;
|
||||
|
|
15
src/test/run-pass/spawn2.rs
Normal file
15
src/test/run-pass/spawn2.rs
Normal file
|
@ -0,0 +1,15 @@
|
|||
// xfail-stage0
|
||||
// xfail-stage1
|
||||
// xfail-stage2
|
||||
// -*- rust -*-
|
||||
|
||||
use std;
|
||||
|
||||
fn main() {
|
||||
spawn child(10, 20);
|
||||
}
|
||||
|
||||
fn child(int i, int j) {
|
||||
log_err i;
|
||||
log_err j;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue