Fix bug in StmtList::EmitCode()
Previously, we would return immediately if the current basic block was NULL; however, this is the wrong thing to do in that goto labels and case/default labels in switch statements will establish a new current basic block even if the current one is NULL.
This commit is contained in:
3
stmt.cpp
3
stmt.cpp
@@ -2046,9 +2046,6 @@ LabeledStmt::EstimateCost() const {
|
|||||||
|
|
||||||
void
|
void
|
||||||
StmtList::EmitCode(FunctionEmitContext *ctx) const {
|
StmtList::EmitCode(FunctionEmitContext *ctx) const {
|
||||||
if (!ctx->GetCurrentBasicBlock())
|
|
||||||
return;
|
|
||||||
|
|
||||||
ctx->StartScope();
|
ctx->StartScope();
|
||||||
ctx->SetDebugPos(pos);
|
ctx->SetDebugPos(pos);
|
||||||
for (unsigned int i = 0; i < stmts.size(); ++i)
|
for (unsigned int i = 0; i < stmts.size(); ++i)
|
||||||
|
|||||||
Reference in New Issue
Block a user