@@ -127,7 +127,7 @@ fn shim_types(ccx: @mut CrateContext, id: ast::node_id) -> ShimTypes {
127127 llsig : llsig,
128128 ret_def : ret_def,
129129 bundle_ty : bundle_ty,
130- shim_fn_ty : T_fn ( [ T_ptr ( bundle_ty) ] , T_nil ( ) ) ,
130+ shim_fn_ty : T_fn ( [ T_ptr ( bundle_ty) ] , T_void ( ) ) ,
131131 fn_ty : fn_ty
132132 }
133133}
@@ -170,7 +170,7 @@ fn build_shim_fn_(ccx: @mut CrateContext,
170170 tie_up_header_blocks ( fcx, lltop) ;
171171
172172 let ret_cx = raw_block ( fcx, false , fcx. llreturn ) ;
173- Ret ( ret_cx, C_null ( T_nil ( ) ) ) ;
173+ RetVoid ( ret_cx) ;
174174
175175 return llshimfn;
176176}
@@ -530,17 +530,21 @@ pub fn trans_foreign_mod(ccx: @mut CrateContext,
530530
531531 store_inbounds ( bcx, llargval, llargbundle, [ 0 u, i] ) ;
532532 }
533- let llretptr = bcx. fcx . llretptr . get ( ) ;
534- store_inbounds ( bcx, llretptr, llargbundle, [ 0 u, n] ) ;
533+
534+ for bcx. fcx. llretptr. iter( ) . advance |& retptr| {
535+ store_inbounds( bcx, retptr, llargbundle, [ 0 u, n] ) ;
536+ }
535537 }
536538
537539 fn build_ret( bcx: block,
538540 shim_types: & ShimTypes ,
539541 llargbundle: ValueRef ) {
540542 let _icx = bcx. insn_ctxt( "foreign::wrap::build_ret" ) ;
541543 let arg_count = shim_types. fn_sig. inputs. len( ) ;
542- let llretptr = load_inbounds ( bcx, llargbundle, [ 0 , arg_count] ) ;
543- Store ( bcx, Load ( bcx, llretptr) , bcx. fcx . llretptr . get ( ) ) ;
544+ for bcx. fcx. llretptr. iter( ) . advance |& retptr| {
545+ let llretptr = load_inbounds( bcx, llargbundle, [ 0 , arg_count] ) ;
546+ Store ( bcx, Load ( bcx, llretptr) , retptr) ;
547+ }
544548 build_return( bcx) ;
545549 }
546550 }
@@ -1294,7 +1298,7 @@ pub fn trans_foreign_fn(ccx: @mut CrateContext,
12941298 shim_types: & ShimTypes ,
12951299 llargbundle: ValueRef ,
12961300 llretval: ValueRef ) {
1297- if ty:: type_is_immediate ( shim_types. fn_sig . output ) {
1301+ if bcx . fcx . llretptr . is_some ( ) && ty:: type_is_immediate( shim_types. fn_sig. output) {
12981302 // Write the value into the argument bundle.
12991303 let arg_count = shim_types. fn_sig. inputs. len( ) ;
13001304 let llretptr = load_inbounds( bcx,
0 commit comments