mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +02:00
Fixed mangling for bind thunks
This commit is contained in:
parent
2192305800
commit
f949a02840
2 changed files with 13 additions and 5 deletions
|
@ -10150,16 +10150,21 @@ void BfExprEvaluator::Visit(BfDelegateBindExpression* delegateBindExpr)
|
|||
|
||||
auto _GetInvokeMethodName = [&]()
|
||||
{
|
||||
String methodName = "Invoke@";
|
||||
String methodName = "Invoke$";
|
||||
methodName += mModule->mCurMethodInstance->mMethodDef->mName;
|
||||
|
||||
int prevSepPos = (int)methodName.LastIndexOf('$');
|
||||
if (prevSepPos != -1)
|
||||
if (prevSepPos > 6)
|
||||
{
|
||||
methodName.RemoveToEnd(prevSepPos);
|
||||
}
|
||||
|
||||
auto rootMethodState = mModule->mCurMethodState->GetRootMethodState();
|
||||
HashContext hashCtx;
|
||||
|
||||
if (mModule->mCurMethodInstance->mMethodDef->mDeclaringType->mPartialIdx != -1)
|
||||
hashCtx.Mixin(mModule->mCurMethodInstance->mMethodDef->mDeclaringType->mPartialIdx);
|
||||
|
||||
if (delegateBindExpr->mFatArrowToken != NULL)
|
||||
{
|
||||
hashCtx.Mixin(delegateBindExpr->mFatArrowToken->GetStartCharId());
|
||||
|
@ -10178,7 +10183,10 @@ void BfExprEvaluator::Visit(BfDelegateBindExpression* delegateBindExpr)
|
|||
|
||||
methodName += '$';
|
||||
methodName += BfTypeUtils::HashEncode64(hashVal.mLow);
|
||||
return methodName;
|
||||
|
||||
String mangledName;
|
||||
BfMangler::MangleMethodName(mangledName, mModule->mCompiler->GetMangleKind(), mModule->mCurTypeInstance, methodName);
|
||||
return mangledName;
|
||||
};
|
||||
|
||||
if ((delegateBindExpr->mNewToken == NULL) || (delegateTypeInstance->IsFunction()))
|
||||
|
|
|
@ -2180,8 +2180,8 @@ void BfMSMangler::MangleMethodName(StringImpl& name, bool is64Bit, BfTypeInstanc
|
|||
mangleContext.mModule = type->GetModule();
|
||||
name += '?';
|
||||
AddStr(mangleContext, name, methodName);
|
||||
Mangle(mangleContext, name, type);
|
||||
name += "@@";
|
||||
Mangle(mangleContext, name, type, true);
|
||||
name += "SAXXZ";
|
||||
}
|
||||
|
||||
void BfMSMangler::MangleStaticFieldName(StringImpl& name, bool is64Bit, BfTypeInstance* owner, const StringImpl& fieldName, BfType* fieldType)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue