mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Fixed lookup infinite field loop during custom attribute population
This commit is contained in:
parent
fb0bace727
commit
cffd849045
2 changed files with 9 additions and 28 deletions
|
@ -4248,6 +4248,14 @@ BfTypedValue BfExprEvaluator::LookupField(BfAstNode* targetSrc, BfTypedValue tar
|
||||||
mModule->PopulateType(startCheckType, BfPopulateType_BaseType);
|
mModule->PopulateType(startCheckType, BfPopulateType_BaseType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((startCheckType != NULL) && (mModule->mContext->mCurTypeState != NULL))
|
||||||
|
{
|
||||||
|
// Don't allow lookups yet
|
||||||
|
if ((mModule->mContext->mCurTypeState->mResolveKind == BfTypeState::ResolveKind_Attributes) &&
|
||||||
|
(startCheckType == mModule->mContext->mCurTypeState->mTypeInstance))
|
||||||
|
return BfTypedValue();
|
||||||
|
}
|
||||||
|
|
||||||
String findName;
|
String findName;
|
||||||
int varSkipCount = 0;
|
int varSkipCount = 0;
|
||||||
if (fieldName.StartsWith('@'))
|
if (fieldName.StartsWith('@'))
|
||||||
|
|
|
@ -13802,33 +13802,6 @@ BfTypedValue BfModule::GetThis()
|
||||||
return BfTypedValue();
|
return BfTypedValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (useMethodState->HasNonStaticMixin())
|
|
||||||
// {
|
|
||||||
// auto checkMethodState = useMethodState;
|
|
||||||
// while (checkMethodState != NULL)
|
|
||||||
// {
|
|
||||||
// for (int localIdx = (int)checkMethodState->mLocals.size() - 1; localIdx >= 0; localIdx--)
|
|
||||||
// {
|
|
||||||
// auto varDecl = checkMethodState->mLocals[localIdx];
|
|
||||||
// if (varDecl->mName == "this")
|
|
||||||
// {
|
|
||||||
// varDecl->mReadFromId = useMethodState->GetRootMethodState()->mCurAccessId++;
|
|
||||||
// if (varDecl->mIsSplat)
|
|
||||||
// {
|
|
||||||
// return BfTypedValue(varDecl->mValue, varDecl->mResolvedType, BfTypedValueKind_ThisSplatHead);
|
|
||||||
// }
|
|
||||||
// else if ((varDecl->mResolvedType->IsValueType()) && (varDecl->mAddr))
|
|
||||||
// {
|
|
||||||
// return BfTypedValue(varDecl->mAddr, varDecl->mResolvedType, BfTypedValueKind_ThisAddr);
|
|
||||||
// }
|
|
||||||
// return BfTypedValue(varDecl->mValue, varDecl->mResolvedType, varDecl->mResolvedType->IsValueType() ? BfTypedValueKind_ThisAddr : BfTypedValueKind_ThisValue);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// checkMethodState = checkMethodState->mPrevMethodState;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Check mixin state for 'this'
|
// Check mixin state for 'this'
|
||||||
{
|
{
|
||||||
auto checkMethodState = mCurMethodState;
|
auto checkMethodState = mCurMethodState;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue