Skip to content

Commit 110ca97

Browse files
committed
---
yaml --- r: 7054 b: refs/heads/master c: 54cf0e9 h: refs/heads/master v: v3
1 parent b2c8025 commit 110ca97

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
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: 75f84b2563f2d644a3d0cae4c2bc66c483008936
2+
refs/heads/master: 54cf0e9c0d1151f82e86cab5488162bd7e0706a2

trunk/src/comp/middle/trans.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3176,15 +3176,22 @@ fn trans_args(cx: @block_ctxt, llenv: ValueRef,
31763176
_ { }
31773177
}
31783178
// Arg 0: Output pointer.
3179-
let llretty = type_of_or_i8(bcx, full_retty);
31803179
let llretslot = alt dest {
31813180
ignore. {
31823181
if ty::type_is_nil(tcx, retty) {
3183-
llvm::LLVMGetUndef(T_ptr(llretty))
3184-
} else { alloca(cx, llretty) }
3182+
llvm::LLVMGetUndef(T_ptr(T_nil()))
3183+
} else {
3184+
let {bcx: cx, val} = alloc_ty(bcx, full_retty);
3185+
bcx = cx;
3186+
val
3187+
}
31853188
}
31863189
save_in(dst) { dst }
3187-
by_val(_) { alloca(cx, llretty) }
3190+
by_val(_) {
3191+
let {bcx: cx, val} = alloc_ty(bcx, full_retty);
3192+
bcx = cx;
3193+
val
3194+
}
31883195
};
31893196

31903197
if ty::type_contains_params(tcx, retty) {

0 commit comments

Comments
 (0)