1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-16 23:34:10 +02:00

Sized array mangle fixes

This commit is contained in:
Brian Fiete 2021-11-03 07:46:54 -07:00
parent 5674bf80c0
commit 613aa116f4

View file

@ -583,12 +583,24 @@ void BfGNUMangler::Mangle(MangleContext& mangleContext, StringImpl& name, BfType
return; return;
} }
else if (type->IsSizedArray()) else if (type->IsSizedArray())
{
if (type->IsUnknownSizedArrayType())
{
BfUnknownSizedArrayType* arrayType = (BfUnknownSizedArrayType*)type;
name += "A_";
Mangle(mangleContext, name, arrayType->mElementType);
name += "_";
Mangle(mangleContext, name, arrayType->mElementCountSource);
return;
}
else
{ {
BfSizedArrayType* arrayType = (BfSizedArrayType*)type; BfSizedArrayType* arrayType = (BfSizedArrayType*)type;
name += StrFormat("A%d_"); name += StrFormat("A%d_", arrayType->mElementCount);
Mangle(mangleContext, name, arrayType->mElementType); Mangle(mangleContext, name, arrayType->mElementType);
return; return;
} }
}
else if (type->IsMethodRef()) else if (type->IsMethodRef())
{ {
auto methodRefType = (BfMethodRefType*)type; auto methodRefType = (BfMethodRefType*)type;
@ -1714,7 +1726,7 @@ void BfMSMangler::Mangle(MangleContext& mangleContext, StringImpl& name, BfType*
name += "?$_ARRAY@"; name += "?$_ARRAY@";
Mangle(mangleContext, name, arrType->mElementType); Mangle(mangleContext, name, arrType->mElementType);
MangleConst(mangleContext, name, arrType->mSize); MangleConst(mangleContext, name, arrType->mElementCount);
name += '@'; name += '@';
} }
} }