mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 12:02:21 +02:00
Fixed string gv to stringId
This commit is contained in:
parent
16f307f7ca
commit
e11c4aa0fe
1 changed files with 9 additions and 1 deletions
|
@ -203,7 +203,15 @@ BfTypedValue BfConstResolver::Resolve(BfExpression* expr, BfType* wantType, BfCo
|
||||||
{
|
{
|
||||||
auto constant = mModule->mBfIRBuilder->GetConstant(mResult.mValue);
|
auto constant = mModule->mBfIRBuilder->GetConstant(mResult.mValue);
|
||||||
if ((constant->mConstType == BfConstType_GlobalVar) && ((flags & BfConstResolveFlag_AllowGlobalVariable) == 0))
|
if ((constant->mConstType == BfConstType_GlobalVar) && ((flags & BfConstResolveFlag_AllowGlobalVariable) == 0))
|
||||||
isConst = false;
|
{
|
||||||
|
int stringId = mModule->GetStringPoolIdx(mResult.mValue, mModule->mBfIRBuilder);
|
||||||
|
if (stringId != -1)
|
||||||
|
{
|
||||||
|
mResult.mValue = mModule->mBfIRBuilder->CreateConst(BfTypeCode_StringId, stringId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
isConst = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!isConst) && ((mBfEvalExprFlags & BfEvalExprFlags_AllowNonConst) == 0))
|
if ((!isConst) && ((mBfEvalExprFlags & BfEvalExprFlags_AllowNonConst) == 0))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue