From 0223bb85ee0bcc1ca1b71fd7f40ef2244b611a25 Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Wed, 11 Jan 2012 09:14:39 -0800 Subject: [PATCH] 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. --- stmt.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/stmt.cpp b/stmt.cpp index 079919b2..783d0a5d 100644 --- a/stmt.cpp +++ b/stmt.cpp @@ -2046,9 +2046,6 @@ LabeledStmt::EstimateCost() const { void StmtList::EmitCode(FunctionEmitContext *ctx) const { - if (!ctx->GetCurrentBasicBlock()) - return; - ctx->StartScope(); ctx->SetDebugPos(pos); for (unsigned int i = 0; i < stmts.size(); ++i)