1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Fixed 'unreachable' for comprehensive switch

This commit is contained in:
Brian Fiete 2020-02-21 11:26:41 -08:00
parent 590df7aec7
commit 748f7b8e49

View file

@ -4623,7 +4623,7 @@ void BfModule::Visit(BfSwitchStatement* switchStmt)
mCurMethodState->SetHadReturn(true);
mCurMethodState->mLeftBlockUncond = true;
if (defaultBlock != endBlock)
if ((defaultBlock != endBlock) && (switchStmt->mDefaultCase != NULL))
mBfIRBuilder->DeleteBlock(endBlock);
else
{