mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Fix GetStringPoolIdx with non-const arg
This commit is contained in:
parent
bb73aced22
commit
213aea8c82
1 changed files with 4 additions and 3 deletions
|
@ -1759,12 +1759,13 @@ BfIRValue BfModule::CreateStringObjectValue(const StringImpl& str, int stringId,
|
|||
|
||||
int BfModule::GetStringPoolIdx(BfIRValue constantStr, BfIRConstHolder* constHolder)
|
||||
{
|
||||
BF_ASSERT(constantStr.IsConst());
|
||||
|
||||
if (constHolder == NULL)
|
||||
constHolder = mBfIRBuilder;
|
||||
|
||||
auto constant = constHolder->GetConstant(constantStr);
|
||||
if (constant == NULL)
|
||||
return -1;
|
||||
|
||||
if (constant->mTypeCode == BfTypeCode_StringId)
|
||||
{
|
||||
return constant->mInt32;
|
||||
|
@ -2701,7 +2702,7 @@ void BfModule::UpdateSrcPos(BfAstNode* astNode, BfSrcPosFlags flags, int debugLo
|
|||
mCurFilePosition.mCurColumn = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
mCurFilePosition.mCurColumn++;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue