about summary refs log tree commit diff
path: root/src/comp
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2011-03-10 11:27:51 -0800
committerPatrick Walton <pcwalton@mimiga.net>2011-03-10 11:46:37 -0800
commit7505c1fa2319adbd928847ca27f75f5a95eb7c3d (patch)
treec45f069261fc29b146993be4041b336b18178516 /src/comp
parent0d3cec71a3282a090903a919d418c638a3b1ebe6 (diff)
rustc: Run cleanups on while expressions' condition blocks. Un-XFAIL while-prelude-drop.rs.
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/middle/trans.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index 172f731be65..ac3d78e7302 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -3005,9 +3005,9 @@ fn trans_while(@block_ctxt cx, @ast.expr cond,
     auto cond_res = trans_expr(cond_cx, cond);
 
     body_res.bcx.build.Br(cond_cx.llbb);
-    cond_res.bcx.build.CondBr(cond_res.val,
-                              body_cx.llbb,
-                              next_cx.llbb);
+
+    auto cond_bcx = trans_block_cleanups(cond_res.bcx, cond_cx);
+    cond_bcx.build.CondBr(cond_res.val, body_cx.llbb, next_cx.llbb);
 
     cx.build.Br(cond_cx.llbb);
     ret res(next_cx, C_nil());