Using type_of_or_i8 did, predictably, allocate an i8 for a type parameter,
which leads to memory corruption and general confusion.
Closes #1443
_ { }
}
// Arg 0: Output pointer.
_ { }
}
// Arg 0: Output pointer.
- let llretty = type_of_or_i8(bcx, full_retty);
let llretslot = alt dest {
ignore. {
if ty::type_is_nil(tcx, retty) {
let llretslot = alt dest {
ignore. {
if ty::type_is_nil(tcx, retty) {
- llvm::LLVMGetUndef(T_ptr(llretty))
- } else { alloca(cx, llretty) }
+ llvm::LLVMGetUndef(T_ptr(T_nil()))
+ } else {
+ let {bcx: cx, val} = alloc_ty(bcx, full_retty);
+ bcx = cx;
+ val
+ }
- by_val(_) { alloca(cx, llretty) }
+ by_val(_) {
+ let {bcx: cx, val} = alloc_ty(bcx, full_retty);
+ bcx = cx;
+ val
+ }
};
if ty::type_contains_params(tcx, retty) {
};
if ty::type_contains_params(tcx, retty) {