aboutsummaryrefslogtreecommitdiff
path: root/src/comp
diff options
context:
space:
mode:
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/middle/trans.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index 17ec85c7..9d6e867e 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -4512,10 +4512,19 @@ fn trans_put(@block_ctxt cx, &option.t[@ast.expr] e) -> result {
case (none[@ast.expr]) { }
case (some[@ast.expr](?x)) {
auto r = trans_expr(bcx, x);
- llargs += r.val;
+
+ auto llarg = r.val;
bcx = r.bcx;
+ if (ty.type_is_structural(ty.expr_ty(x))) {
+ // Until here we've been treating structures by pointer; we
+ // are now passing it as an arg, so need to load it.
+ llarg = bcx.build.Load(llarg);
+ }
+
+ llargs += llarg;
}
}
+
ret res(bcx, bcx.build.FastCall(llcallee, llargs));
}