|
@@ -1759,12 +1759,13 @@ BfIRValue BfModule::CreateStringObjectValue(const StringImpl& str, int stringId,
|
|
|
|
|
|
int BfModule::GetStringPoolIdx(BfIRValue constantStr, BfIRConstHolder* constHolder)
|
|
int BfModule::GetStringPoolIdx(BfIRValue constantStr, BfIRConstHolder* constHolder)
|
|
{
|
|
{
|
|
- BF_ASSERT(constantStr.IsConst());
|
|
|
|
-
|
|
|
|
if (constHolder == NULL)
|
|
if (constHolder == NULL)
|
|
constHolder = mBfIRBuilder;
|
|
constHolder = mBfIRBuilder;
|
|
|
|
|
|
auto constant = constHolder->GetConstant(constantStr);
|
|
auto constant = constHolder->GetConstant(constantStr);
|
|
|
|
+ if (constant == NULL)
|
|
|
|
+ return -1;
|
|
|
|
+
|
|
if (constant->mTypeCode == BfTypeCode_StringId)
|
|
if (constant->mTypeCode == BfTypeCode_StringId)
|
|
{
|
|
{
|
|
return constant->mInt32;
|
|
return constant->mInt32;
|
|
@@ -2701,7 +2702,7 @@ void BfModule::UpdateSrcPos(BfAstNode* astNode, BfSrcPosFlags flags, int debugLo
|
|
mCurFilePosition.mCurColumn = 0;
|
|
mCurFilePosition.mCurColumn = 0;
|
|
}
|
|
}
|
|
else
|
|
else
|
|
- {
|
|
|
|
|
|
+ {
|
|
mCurFilePosition.mCurColumn++;
|
|
mCurFilePosition.mCurColumn++;
|
|
}
|
|
}
|
|
|
|
|