mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
NumericCast error check
This commit is contained in:
parent
3fd7e31119
commit
eb7e78174c
1 changed files with 7 additions and 1 deletions
|
@ -1331,7 +1331,13 @@ void BeIRCodeGen::HandleNextCmd()
|
|||
CMD_PARAM(bool, valIsSigned);
|
||||
|
||||
BfTypeCode typeCode = (BfTypeCode)mStream->Read();
|
||||
BfTypeCode valTypeCode = GetTypeCode(val->GetType(), valIsSigned);
|
||||
auto valType = val->GetType();
|
||||
if ((!valType->IsIntable()) && (!valType->IsFloat()))
|
||||
{
|
||||
Fail("Invalid NumericCast target");
|
||||
}
|
||||
|
||||
BfTypeCode valTypeCode = GetTypeCode(valType, valIsSigned);
|
||||
|
||||
if (auto srcCastConstant = BeValueDynCast<BeCastConstant>(val))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue