mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Fixed erroneous char ptr const generation
This commit is contained in:
parent
31af480c92
commit
e871bd6ace
1 changed files with 9 additions and 12 deletions
|
@ -2971,9 +2971,9 @@ void BfIRBuilder::CreateDbgTypeDefinition(BfType* type)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isPayloadEnum = (typeInstance->IsEnum()) && (!typeInstance->IsTypedPrimitive());
|
bool isPayloadEnum = (typeInstance->IsEnum()) && (!typeInstance->IsTypedPrimitive());
|
||||||
for (auto& fieldInstanceRef : typeInstance->mFieldInstances)
|
for (int fieldIdx = 0; fieldIdx < typeInstance->mFieldInstances.mSize; fieldIdx++)
|
||||||
{
|
{
|
||||||
auto fieldInstance = &fieldInstanceRef;
|
auto fieldInstance = &typeInstance->mFieldInstances[fieldIdx];
|
||||||
if (!fieldInstance->mFieldIncluded)
|
if (!fieldInstance->mFieldIncluded)
|
||||||
continue;
|
continue;
|
||||||
auto fieldDef = fieldInstance->GetFieldDef();
|
auto fieldDef = fieldInstance->GetFieldDef();
|
||||||
|
@ -3092,17 +3092,14 @@ void BfIRBuilder::CreateDbgTypeDefinition(BfType* type)
|
||||||
staticValue = ConstToMemory(staticValue);
|
staticValue = ConstToMemory(staticValue);
|
||||||
wasMadeAddr = true;
|
wasMadeAddr = true;
|
||||||
}
|
}
|
||||||
else if (resolvedFieldType->IsPointer())
|
|
||||||
{
|
|
||||||
int stringId = constant->mInt32;
|
|
||||||
const StringImpl& str = mModule->mContext->mStringObjectIdMap[stringId].mString;
|
|
||||||
staticValue = mModule->GetStringCharPtr(str);
|
|
||||||
}
|
|
||||||
else if (constant->mTypeCode == BfTypeCode_StringId)
|
else if (constant->mTypeCode == BfTypeCode_StringId)
|
||||||
{
|
{
|
||||||
int stringId = constant->mInt32;
|
int stringId = constant->mInt32;
|
||||||
const StringImpl& str = mModule->mContext->mStringObjectIdMap[stringId].mString;
|
const StringImpl& str = mModule->mContext->mStringObjectIdMap[stringId].mString;
|
||||||
staticValue = mModule->GetStringObjectValue(str);
|
if (resolvedFieldType->IsPointer())
|
||||||
|
staticValue = mModule->GetStringCharPtr(str);
|
||||||
|
else
|
||||||
|
staticValue = mModule->GetStringObjectValue(str);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue