mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue