1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Fixed @this crash

This commit is contained in:
Brian Fiete 2025-03-13 06:11:12 -04:00
parent 381c629a03
commit 86e32fbd67

View file

@ -4982,7 +4982,12 @@ BfTypedValue BfExprEvaluator::LookupIdentifier(BfAstNode* refNode, const StringI
{ {
auto thisLocal = mModule->mCurMethodState->mLocals[0]; auto thisLocal = mModule->mCurMethodState->mLocals[0];
if (thisLocal->mIsThis) if (thisLocal->mIsThis)
{
if (thisLocal->mAddr)
return BfTypedValue(mModule->mBfIRBuilder->CreateLoad(thisLocal->mAddr), thisLocal->mResolvedType); return BfTypedValue(mModule->mBfIRBuilder->CreateLoad(thisLocal->mAddr), thisLocal->mResolvedType);
else
return BfTypedValue(thisLocal->mValue, thisLocal->mResolvedType);
}
} }
} }
} }