about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2010-11-12 11:48:18 -0800
committerGraydon Hoare <graydon@mozilla.com>2010-11-12 11:48:18 -0800
commit2ff0662eaef0af2a7a0173e5da53fe271c217e38 (patch)
tree888da5a57fd9665ddbf61ee920b0186022b16e54 /src
parent1ff88982fe07b341c79345277f857211eccc5a5e (diff)
Load outptr alloca as retval; function call/return now works in rustc.
Diffstat (limited to 'src')
-rw-r--r--src/comp/middle/trans.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index 17d1a141125..820989352a5 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -917,13 +917,17 @@ impure fn trans_expr(@block_ctxt cx, &ast.expr e) -> result {
                 case (ast.item_fn(_, ?ff, _, _)) {
                     outptr = cx.build.Alloca(type_of(cx.fcx.tcx, ff.output));
                 }
+                case (_) {
+                    cx.fcx.tcx.sess.unimpl("call to non-item");
+                }
             }
             auto args_res = trans_exprs(f_res._0.bcx, args);
             auto llargs = vec(outptr,
                               cx.fcx.lltaskptr);
             llargs += args_res._1;
+            auto call_val = args_res._0.build.Call(f_res._0.val, llargs);
             ret res(args_res._0,
-                    args_res._0.build.Call(f_res._0.val, llargs));
+                    args_res._0.build.Load(outptr));
         }
 
     }