1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42: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 (caseValue.mType == switchValue.mType)
if ((constantInt != NULL) && (!mBfIRBuilder->IsInt(constantInt->mTypeCode))) {
constantInt = NULL; constantInt = mBfIRBuilder->GetConstant(caseValue.mValue);
if ((constantInt != NULL) && (!mBfIRBuilder->IsInt(constantInt->mTypeCode)))
constantInt = NULL;
}
} }
} }