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:
3
func.cpp
3
func.cpp
@@ -334,11 +334,12 @@ Function::emitCode(FunctionEmitContext *ctx, llvm::Function *function,
|
|||||||
if (ctx->GetCurrentBasicBlock())
|
if (ctx->GetCurrentBasicBlock())
|
||||||
ctx->ReturnInst();
|
ctx->ReturnInst();
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
// Set up basic blocks for goto targets
|
// Set up basic blocks for goto targets
|
||||||
ctx->InitializeLabelMap(code);
|
ctx->InitializeLabelMap(code);
|
||||||
// No check, just emit the code
|
// No check, just emit the code
|
||||||
code->EmitCode(ctx);
|
code->EmitCode(ctx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->GetCurrentBasicBlock()) {
|
if (ctx->GetCurrentBasicBlock()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user