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

Fixed an issue using global variables in method attributes

This commit is contained in:
Brian Fiete 2020-05-09 07:24:34 -07:00
parent 1aa66761ad
commit 2e83062143
2 changed files with 3 additions and 1 deletions

View file

@ -3148,7 +3148,7 @@ BfTypedValue BfExprEvaluator::LookupIdentifier(BfAstNode* refNode, const StringI
}
if (!thisValue.HasType())
thisValue = BfTypedValue(mModule->mCurTypeInstance);
thisValue = BfTypedValue(mModule->mCurTypeInstance);
BfTypedValue result = LookupField(identifierNode, thisValue, findName, BfLookupFieldFlag_IsImplicitThis);
if (mPropDef != NULL)
{

View file

@ -18788,6 +18788,8 @@ void BfModule::GetMethodCustomAttributes(BfMethodInstance* methodInstance)
auto propertyMethodDeclaration = methodDef->GetPropertyMethodDeclaration();
auto typeInstance = methodInstance->GetOwner();
BfTypeState typeState(typeInstance);
SetAndRestoreValue<BfTypeState*> prevTypeState(mContext->mCurTypeState, &typeState);
SetAndRestoreValue<BfTypeInstance*> prevTypeInstance(mCurTypeInstance, typeInstance);
SetAndRestoreValue<BfMethodInstance*> prevMethodInstance(mCurMethodInstance, methodInstance);