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

Fixed incorrectly allowed type mismatch on payload enum case

This commit is contained in:
Brian Fiete 2020-12-19 08:26:00 -08:00
parent 9d3e245f69
commit 49c2a69a45

View file

@ -4464,9 +4464,12 @@ void BfModule::Visit(BfSwitchStatement* switchStmt)
}
}
constantInt = mBfIRBuilder->GetConstant(caseValue.mValue);
if ((constantInt != NULL) && (!mBfIRBuilder->IsInt(constantInt->mTypeCode)))
constantInt = NULL;
if (caseValue.mType == switchValue.mType)
{
constantInt = mBfIRBuilder->GetConstant(caseValue.mValue);
if ((constantInt != NULL) && (!mBfIRBuilder->IsInt(constantInt->mTypeCode)))
constantInt = NULL;
}
}
}