Fix #335, log context needs to be a scope to capture cleanups.
This commit is contained in:
parent
2e6711fca5
commit
9034a8fbd6
2 changed files with 7 additions and 1 deletions
|
|
@ -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));
|
||||
|
|
|
|||
6
src/test/run-pass/log-err-phi.rs
Normal file
6
src/test/run-pass/log-err-phi.rs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
fn main() {
|
||||
if (false) {
|
||||
log_err "foo" + "bar";
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue