Fix #335, log context needs to be a scope to capture cleanups.

This commit is contained in:
Graydon Hoare 2011-04-20 04:55:55 +00:00
parent 2e6711fca5
commit 9034a8fbd6
2 changed files with 7 additions and 1 deletions

View file

@ -5133,7 +5133,7 @@ fn trans_log(int lvl, @block_ctxt cx, @ast.expr e) -> result {
lcx.ccx.module_data.insert(modname, global);
}
auto log_cx = new_sub_block_ctxt(cx, "log");
auto log_cx = new_scope_block_ctxt(cx, "log");
auto after_cx = new_sub_block_ctxt(cx, "after");
auto load = cx.build.Load(global);
auto test = cx.build.ICmp(lib.llvm.LLVMIntSGE, load, C_int(lvl));

View file

@ -0,0 +1,6 @@
fn main() {
if (false) {
log_err "foo" + "bar";
}
}