1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Fixed invalid 'this' lookup during const type resolution

This commit is contained in:
Brian Fiete 2021-07-05 08:28:16 -07:00
parent 9154511e78
commit ee06457b2f

View file

@ -13991,8 +13991,11 @@ BfTypedValue BfModule::GetThis()
return BfTypedValue(GetDefaultValue(thisType), thisType, BfTypedValueKind_ThisValue); return BfTypedValue(GetDefaultValue(thisType), thisType, BfTypedValueKind_ThisValue);
} }
} }
auto localDef = useMethodState->mLocals[0]; if (mCurMethodInstance == NULL)
return BfTypedValue();
auto localDef = useMethodState->mLocals[0];
auto curMethodOwner = mCurMethodInstance->mMethodInstanceGroup->mOwner; auto curMethodOwner = mCurMethodInstance->mMethodInstanceGroup->mOwner;
if ((curMethodOwner->IsStruct()) || (curMethodOwner->IsTypedPrimitive())) if ((curMethodOwner->IsStruct()) || (curMethodOwner->IsTypedPrimitive()))
{ {