Skip to content

Commit e032f83

Browse files
committed
---
yaml --- r: 14826 b: refs/heads/try c: aeb445b h: refs/heads/master v: v3
1 parent add6511 commit e032f83

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: b87cdd857228e576d0fcccba0d92b0b231375923
5+
refs/heads/try: aeb445b2ea25f9629df1d5d8fbd2906a92c8e719
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/rustc/middle/trans/base.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2001,10 +2001,12 @@ fn trans_for(cx: block, local: @ast::local, seq: @ast::expr,
20012001
fn trans_while(cx: block, cond: @ast::expr, body: ast::blk)
20022002
-> block {
20032003
let next_cx = sub_block(cx, "while next");
2004-
let cond_cx = loop_scope_block(cx, cont_self, next_cx,
2005-
"while cond", body.span);
2006-
let body_cx = scope_block(cond_cx, "while loop body");
2007-
Br(cx, cond_cx.llbb);
2004+
let loop_cx = loop_scope_block(cx, cont_self, next_cx,
2005+
"while loop", body.span);
2006+
let cond_cx = scope_block(loop_cx, "while loop cond");
2007+
let body_cx = scope_block(loop_cx, "while loop body");
2008+
Br(cx, loop_cx.llbb);
2009+
Br(loop_cx, cond_cx.llbb);
20082010
let cond_res = trans_temp_expr(cond_cx, cond);
20092011
let cond_bcx = trans_block_cleanups(cond_res.bcx, cond_cx);
20102012
CondBr(cond_bcx, cond_res.val, body_cx.llbb, next_cx.llbb);
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Issue 1974
2+
// Don't double free the condition allocation
3+
fn main() {
4+
let s = "hej";
5+
while s != "" {
6+
ret;
7+
}
8+
}

0 commit comments

Comments
 (0)