@@ -2649,9 +2649,8 @@ fn trans_arg_expr(cx: block, arg: ty::arg, lldestty: TypeRef, e: @ast::expr,
2649
2649
// - new_fn_ctxt
2650
2650
// - trans_args
2651
2651
fn trans_args ( cx : block , llenv : ValueRef , es : [ @ast:: expr ] , fn_ty : ty:: t ,
2652
- dest : dest ) -> { bcx : block,
2653
- args : [ ValueRef ] ,
2654
- retslot : ValueRef } {
2652
+ dest : dest , generic_intrinsic : bool )
2653
+ -> { bcx : block, args : [ ValueRef ] , retslot : ValueRef } {
2655
2654
2656
2655
let temp_cleanups = [ ] ;
2657
2656
let args = ty:: ty_fn_args ( fn_ty) ;
@@ -2664,7 +2663,7 @@ fn trans_args(cx: block, llenv: ValueRef, es: [@ast::expr], fn_ty: ty::t,
2664
2663
// Arg 0: Output pointer.
2665
2664
let llretslot = alt dest {
2666
2665
ignore {
2667
- if ty:: type_is_nil ( retty) {
2666
+ if ty:: type_is_nil ( retty) && !generic_intrinsic {
2668
2667
llvm:: LLVMGetUndef ( T_ptr ( T_nil ( ) ) )
2669
2668
} else {
2670
2669
let { bcx: cx , val } = alloc_ty ( bcx, retty) ;
@@ -2748,7 +2747,8 @@ fn trans_call_inner(in_cx: block, fn_expr_ty: ty::t,
2748
2747
} ;
2749
2748
2750
2749
let ret_ty = node_id_type ( bcx, id) ;
2751
- let args_res = trans_args ( bcx, llenv, args, fn_expr_ty, dest) ;
2750
+ let args_res = trans_args ( bcx, llenv, args, fn_expr_ty, dest,
2751
+ option:: is_some ( f_res. tds ) ) ;
2752
2752
bcx = args_res. bcx ;
2753
2753
let llargs = args_res. args ;
2754
2754
option:: may ( f_res. tds ) { |vals|
0 commit comments