Fix bug with multiple EmitCode() calls due to missing braces.

In short, we were inadvertently trying to emit each function's
code a second time if the function had a mask check at the start
of it.  StmtList::EmitCode() was covering this error up by
not emitting code if the current basic block is NULL.
This commit is contained in:
Matt Pharr
2012-01-10 16:50:13 -08:00
parent f4653ecd11
commit 8a8e1a7f73

View File

@@ -334,11 +334,12 @@ Function::emitCode(FunctionEmitContext *ctx, llvm::Function *function,
if (ctx->GetCurrentBasicBlock())
ctx->ReturnInst();
}
else
else {
// Set up basic blocks for goto targets
ctx->InitializeLabelMap(code);
// No check, just emit the code
code->EmitCode(ctx);
}
}
if (ctx->GetCurrentBasicBlock()) {