@@ -561,17 +561,32 @@ fn trans_rvalue_stmt_unadjusted(bcx: block, expr: @ast::expr) -> block {
561561 clobs, volatile, alignstack) => {
562562 let mut constraints = ~[ ] ;
563563 let mut cleanups = ~[ ] ;
564+ let mut aoutputs = ~[ ] ;
564565
565566 let outputs = do outs. map |& ( c, out) | {
566567 constraints. push ( copy * c) ;
567568
568- let outty = ty:: arg {
569+ let aoutty = ty:: arg {
569570 mode : ast:: expl ( ast:: by_val) ,
570571 ty : expr_ty ( bcx, out)
571572 } ;
573+ aoutputs. push ( unpack_result ! ( bcx, {
574+ callee:: trans_arg_expr( bcx, aoutty, out, & mut cleanups,
575+ None , callee:: DontAutorefArg )
576+ } ) ) ;
577+
578+ let e = match out. node {
579+ ast:: expr_addr_of( _, e) => e,
580+ _ => fail ! ( ~"Expression must be addr of")
581+ };
582+
583+ let outty = ty::arg {
584+ mode: ast::expl(ast::by_val),
585+ ty: expr_ty(bcx, e)
586+ };
572587
573588 unpack_result!(bcx, {
574- callee:: trans_arg_expr( bcx, outty, out , & mut cleanups,
589+ callee::trans_arg_expr(bcx, outty, e , &mut cleanups,
575590 None, callee::DontAutorefArg)
576591 })
577592
@@ -627,7 +642,7 @@ fn trans_rvalue_stmt_unadjusted(bcx: block, expr: @ast::expr) -> block {
627642 } ;
628643
629644 // TODO: Handle >1 outputs
630- let op = PointerCast ( bcx, output , T_ptr ( val_ty ( output) ) ) ;
645+ let op = PointerCast ( bcx, aoutputs [ 0 ] , T_ptr ( val_ty ( output) ) ) ;
631646 Store ( bcx, r, op) ;
632647
633648 return bcx;
0 commit comments