Skip to content

Commit 8e9e55f

Browse files
committed
---
yaml --- r: 1725 b: refs/heads/master c: c710c9a h: refs/heads/master i: 1723: ea8eae3 v: v3
1 parent 3d4bf5f commit 8e9e55f

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-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: 3f2bae4449b6eac3e970b033763905da5bb3a4f1
2+
refs/heads/master: c710c9a1b81f9231b3227159c9655ac7a2a5e099

trunk/src/comp/middle/trans.rs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4029,11 +4029,6 @@ fn trans_args(@block_ctxt cx,
40294029
auto re = trans_expr(bcx, e);
40304030
val = re.val;
40314031
bcx = re.bcx;
4032-
if (mode == ast.val) {
4033-
// Until here we've been treating structures by pointer;
4034-
// we are now passing it as an arg, so need to load it.
4035-
val = bcx.build.Load(val);
4036-
}
40374032
} else if (mode == ast.alias) {
40384033
let lval_result lv;
40394034
if (ty.is_lval(e)) {
@@ -4063,9 +4058,25 @@ fn trans_args(@block_ctxt cx,
40634058

40644059
if (ty.count_ty_params(args.(i).ty) > 0u) {
40654060
auto lldestty = arg_tys.(i);
4061+
if (mode == ast.val) {
4062+
// FIXME: we'd prefer to use &&, but rustboot doesn't like it
4063+
if (ty.type_is_structural(ty.expr_ty(e))) {
4064+
lldestty = T_ptr(lldestty);
4065+
}
4066+
}
4067+
40664068
val = bcx.build.PointerCast(val, lldestty);
40674069
}
40684070

4071+
if (mode == ast.val) {
4072+
// FIXME: we'd prefer to use &&, but rustboot doesn't like it
4073+
if (ty.type_is_structural(ty.expr_ty(e))) {
4074+
// Until here we've been treating structures by pointer;
4075+
// we are now passing it as an arg, so need to load it.
4076+
val = bcx.build.Load(val);
4077+
}
4078+
}
4079+
40694080
llargs += vec(val);
40704081
i += 1u;
40714082
}

0 commit comments

Comments
 (0)