Skip to content

Commit

Permalink
better coverage for variable_clear()
Browse files Browse the repository at this point in the history
  • Loading branch information
williangaspar committed Feb 26, 2019
1 parent 83e7136 commit 34fdded
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/ast/codegen_llvm.cpp
Expand Up @@ -1241,14 +1241,12 @@ void CodegenLLVM::visit(Probe &probe)
BasicBlock *entry = BasicBlock::Create(module_->getContext(), "entry", func);
b_.SetInsertPoint(entry);

variables_.clear(); // make sure variables are local to the probe

ctx_ = func->arg_begin();

if (probe.pred) {
probe.pred->accept(*this);
}

variables_.clear();
for (Statement *stmt : *probe.stmts) {
stmt->accept(*this);
}
Expand Down Expand Up @@ -1308,6 +1306,7 @@ void CodegenLLVM::visit(Probe &probe)
if (probe.pred) {
probe.pred->accept(*this);
}
variables_.clear();
for (Statement *stmt : *probe.stmts) {
stmt->accept(*this);
}
Expand Down

0 comments on commit 34fdded

Please sign in to comment.