Fix problem with polymorphic return value being instantiated as nil

Closes #1005
This commit is contained in:
Marijn Haverbeke 2011-10-06 09:40:42 +02:00
parent e6d7b0cff3
commit 39b468e17a

View file

@ -3785,7 +3785,7 @@ fn trans_args(cx: @block_ctxt, outer_cx: @block_ctxt, llenv: ValueRef,
} else {
alt dest {
ignore. {
if ty::type_is_nil(tcx, full_retty) ||
if ty::type_is_nil(tcx, retty) ||
!option::is_none(lliterbody) {
llvm::LLVMGetUndef(T_ptr(llretty))
} else { alloca(cx, llretty) }