mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 20:12:21 +02:00
Fixed GetStructRetIdx calculation with closure 'this' override
This commit is contained in:
parent
ea34f0c2fd
commit
cd882b09a5
1 changed files with 11 additions and 4 deletions
|
@ -764,15 +764,17 @@ int BfMethodInstance::GetStructRetIdx(bool forceStatic)
|
|||
if ((returnTypeInst != NULL) && (returnTypeInst->mHasUnderlyingArray))
|
||||
return -1;
|
||||
|
||||
auto owner = mMethodInstanceGroup->mOwner;
|
||||
if (owner->mModule->mCompiler->mOptions.mPlatformType != BfPlatformType_Windows)
|
||||
auto thisType = mMethodInstanceGroup->mOwner;
|
||||
if (thisType->mModule->mCompiler->mOptions.mPlatformType != BfPlatformType_Windows)
|
||||
return 0;
|
||||
if ((mMethodInfoEx != NULL) && (mMethodInfoEx->mClosureInstanceInfo != NULL) && (mMethodInfoEx->mClosureInstanceInfo->mThisOverride != NULL))
|
||||
thisType = mMethodInfoEx->mClosureInstanceInfo->mThisOverride;
|
||||
|
||||
if ((!HasThis()) || (forceStatic))
|
||||
return 0;
|
||||
if (!owner->IsValueType())
|
||||
if (!thisType->IsValueType())
|
||||
return 1;
|
||||
if ((mMethodDef->mIsMutating) || (!owner->IsSplattable()) || ((!AllowsSplatting(-1)) && (!owner->GetLoweredType(BfTypeUsage_Parameter))))
|
||||
if ((mMethodDef->mIsMutating) || (!thisType->IsSplattable()) || ((!AllowsSplatting(-1)) && (!thisType->GetLoweredType(BfTypeUsage_Parameter))))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
@ -1170,6 +1172,11 @@ void BfMethodInstance::GetIRFunctionInfo(BfModule* module, BfIRType& returnType,
|
|||
{
|
||||
module->PopulateType(mReturnType);
|
||||
|
||||
if (mMethodDef->mName.Contains("GroupBy$"))
|
||||
{
|
||||
NOP;
|
||||
}
|
||||
|
||||
BfTypeCode loweredReturnTypeCode = BfTypeCode_None;
|
||||
BfTypeCode loweredReturnTypeCode2 = BfTypeCode_None;
|
||||
if ((!module->mIsComptimeModule) && (GetLoweredReturnType(&loweredReturnTypeCode, &loweredReturnTypeCode2)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue