Skip to content

Commit 9034a8f

Browse files
committed
Fix #335, log context needs to be a scope to capture cleanups.
1 parent 2e6711f commit 9034a8f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/comp/middle/trans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5133,7 +5133,7 @@ fn trans_log(int lvl, @block_ctxt cx, @ast.expr e) -> result {
51335133
lcx.ccx.module_data.insert(modname, global);
51345134
}
51355135

5136-
auto log_cx = new_sub_block_ctxt(cx, "log");
5136+
auto log_cx = new_scope_block_ctxt(cx, "log");
51375137
auto after_cx = new_sub_block_ctxt(cx, "after");
51385138
auto load = cx.build.Load(global);
51395139
auto test = cx.build.ICmp(lib.llvm.LLVMIntSGE, load, C_int(lvl));

src/test/run-pass/log-err-phi.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fn main() {
2+
if (false) {
3+
log_err "foo" + "bar";
4+
}
5+
}
6+

0 commit comments

Comments
 (0)