aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2011-03-10 11:27:51 -0800
committerPatrick Walton <[email protected]>2011-03-10 11:46:37 -0800
commit7505c1fa2319adbd928847ca27f75f5a95eb7c3d (patch)
treec45f069261fc29b146993be4041b336b18178516 /src
parentFix eval typo (caught by Martin Hock). (diff)
downloadrust-7505c1fa2319adbd928847ca27f75f5a95eb7c3d.tar.xz
rust-7505c1fa2319adbd928847ca27f75f5a95eb7c3d.zip
rustc: Run cleanups on while expressions' condition blocks. Un-XFAIL while-prelude-drop.rs.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile1
-rw-r--r--src/comp/middle/trans.rs6
2 files changed, 3 insertions, 4 deletions
diff --git a/src/Makefile b/src/Makefile
index 0bddc0de..fa4ddd20 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -513,7 +513,6 @@ TEST_XFAILS_RUSTC := $(addprefix test/run-pass/, \
vec-alloc-append.rs \
vec-append.rs \
vec-slice.rs \
- while-prelude-drop.rs \
while-with-break.rs \
yield.rs \
yield2.rs \
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index 172f731b..ac3d78e7 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());