Skip to content

Commit 137b73b

Browse files
author
Eric Holk
committed
---
yaml --- r: 2823 b: refs/heads/master c: dad4264 h: refs/heads/master i: 2821: 2471c29 2819: f3292bb 2815: 73ae07d v: v3
1 parent 90fcda6 commit 137b73b

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: bb4c7a9c6818bef1851639f03bb3b5b5a90dd45f
2+
refs/heads/master: dad426419c1c93a90d458d8eee307df7ddb0fc05

trunk/src/comp/middle/trans.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5882,9 +5882,7 @@ fn trans_spawn(&@block_ctxt cx,
58825882
e));
58835883
}
58845884

5885-
// Make the tuple. We have to reverse the types first though.
5886-
//vec::reverse[ty::t](arg_tys);
5887-
//vec::reverse[ValueRef](arg_vals);
5885+
// Make the tuple.
58885886
auto args_ty = ty::mk_imm_tup(cx.fcx.lcx.ccx.tcx, arg_tys);
58895887

58905888
// Allocate and fill the tuple.

trunk/src/rt/rust_task.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,19 @@ rust_task::start(uintptr_t spawnee_fn,
171171
src += 1; // spawn-call task slot
172172
src += 1; // spawn-call closure-or-obj slot
173173

174-
*spp-- = (uintptr_t) *src; // vec
174+
spp -= (args_size / sizeof(uintptr_t)) - 1;
175+
memmove(spp, src, args_size);
176+
spp--;
177+
178+
//*spp-- = (uintptr_t) *src; // vec
179+
175180
*spp-- = (uintptr_t) 0x0; // closure-or-obj
176181
*spp-- = (uintptr_t) this; // task
177182
*spp-- = (uintptr_t) dummy_ret; // output address
178183

179184
I(dom, spp == align_down(spp));
180185
*spp-- = (uintptr_t) (uintptr_t) spawnee_fn;
181186

182-
183187
*spp-- = (uintptr_t) 0x0; // retp
184188

185189
*spp-- = (uintptr_t) rust_new_exit_task_glue;

trunk/src/test/run-pass/spawn2.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// xfail-stage0
2+
// xfail-stage1
3+
// xfail-stage2
4+
// -*- rust -*-
5+
6+
use std;
7+
8+
fn main() {
9+
spawn child(10, 20);
10+
}
11+
12+
fn child(int i, int j) {
13+
log_err i;
14+
log_err j;
15+
}

0 commit comments

Comments
 (0)