1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Fixed erroneous char ptr const generation

This commit is contained in:
Brian Fiete 2021-12-14 09:53:43 -05:00
parent 31af480c92
commit e871bd6ace

View file

@ -2970,10 +2970,10 @@ void BfIRBuilder::CreateDbgTypeDefinition(BfType* type)
diFieldTypes.push_back(memberType);
}
bool isPayloadEnum = (typeInstance->IsEnum()) && (!typeInstance->IsTypedPrimitive());
for (auto& fieldInstanceRef : typeInstance->mFieldInstances)
bool isPayloadEnum = (typeInstance->IsEnum()) && (!typeInstance->IsTypedPrimitive());
for (int fieldIdx = 0; fieldIdx < typeInstance->mFieldInstances.mSize; fieldIdx++)
{
auto fieldInstance = &fieldInstanceRef;
auto fieldInstance = &typeInstance->mFieldInstances[fieldIdx];
if (!fieldInstance->mFieldIncluded)
continue;
auto fieldDef = fieldInstance->GetFieldDef();
@ -3091,18 +3091,15 @@ void BfIRBuilder::CreateDbgTypeDefinition(BfType* type)
{
staticValue = ConstToMemory(staticValue);
wasMadeAddr = true;
}
else if (resolvedFieldType->IsPointer())
}
else if (constant->mTypeCode == BfTypeCode_StringId)
{
int stringId = constant->mInt32;
const StringImpl& str = mModule->mContext->mStringObjectIdMap[stringId].mString;
staticValue = mModule->GetStringCharPtr(str);
}
else if (constant->mTypeCode == BfTypeCode_StringId)
{
int stringId = constant->mInt32;
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
{