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

Fixed globalVar flag handling in const resolve

This commit is contained in:
Brian Fiete 2022-03-01 14:11:11 -08:00
parent 28a03fcc4b
commit 8d6a29c16a

View file

@ -202,8 +202,8 @@ BfTypedValue BfConstResolver::Resolve(BfExpression* expr, BfType* wantType, BfCo
if (isConst)
{
auto constant = mModule->mBfIRBuilder->GetConstant(mResult.mValue);
if ((constant->mConstType == BfConstType_GlobalVar) && ((mBfEvalExprFlags & BfConstResolveFlag_AllowGlobalVariable) != 0))
isConst = false;
if ((constant->mConstType == BfConstType_GlobalVar) && ((flags & BfConstResolveFlag_AllowGlobalVariable) == 0))
isConst = false;
}
if ((!isConst) && ((mBfEvalExprFlags & BfEvalExprFlags_AllowNonConst) == 0))