@@ -2660,9 +2660,8 @@ fn trans_arg_expr(cx: block, arg: ty::arg, lldestty: TypeRef, e: @ast::expr,
2660
2660
// - new_fn_ctxt
2661
2661
// - trans_args
2662
2662
fn trans_args ( cx : block , llenv : ValueRef , es : [ @ast:: expr ] , fn_ty : ty:: t ,
2663
- dest : dest ) -> { bcx : block,
2664
- args : [ ValueRef ] ,
2665
- retslot : ValueRef } {
2663
+ dest : dest , generic_intrinsic : bool )
2664
+ -> { bcx : block, args : [ ValueRef ] , retslot : ValueRef } {
2666
2665
2667
2666
let temp_cleanups = [ ] ;
2668
2667
let args = ty:: ty_fn_args ( fn_ty) ;
@@ -2675,7 +2674,7 @@ fn trans_args(cx: block, llenv: ValueRef, es: [@ast::expr], fn_ty: ty::t,
2675
2674
// Arg 0: Output pointer.
2676
2675
let llretslot = alt dest {
2677
2676
ignore {
2678
- if ty:: type_is_nil ( retty) {
2677
+ if ty:: type_is_nil ( retty) && !generic_intrinsic {
2679
2678
llvm:: LLVMGetUndef ( T_ptr ( T_nil ( ) ) )
2680
2679
} else {
2681
2680
let { bcx: cx , val } = alloc_ty ( bcx, retty) ;
@@ -2759,7 +2758,8 @@ fn trans_call_inner(in_cx: block, fn_expr_ty: ty::t,
2759
2758
} ;
2760
2759
2761
2760
let ret_ty = node_id_type ( bcx, id) ;
2762
- let args_res = trans_args ( bcx, llenv, args, fn_expr_ty, dest) ;
2761
+ let args_res = trans_args ( bcx, llenv, args, fn_expr_ty, dest,
2762
+ option:: is_some ( f_res. tds ) ) ;
2763
2763
bcx = args_res. bcx ;
2764
2764
let llargs = args_res. args ;
2765
2765
option:: may ( f_res. tds ) { |vals|
0 commit comments