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

Fixed global lookup

This commit is contained in:
Brian Fiete 2022-06-15 17:52:48 -07:00
parent f8e57ee5ff
commit 43ebd756af

View file

@ -2531,6 +2531,8 @@ BfTypeDef* BfSystem::FindTypeDef(const BfAtomComposite& findName, int numGeneric
BfTypeDef* foundTypeDef = NULL;
BfAtomCompositeT<16> qualifiedFindName;
bool allowGlobal = (flags & BfFindTypeDefFlag_AllowGlobal) != 0;
int foundPri = (int)0x80000000;
for (int namespaceIdx = 0; namespaceIdx <= (int) namespaceSearch.size(); namespaceIdx++)
{
@ -2556,7 +2558,7 @@ BfTypeDef* BfSystem::FindTypeDef(const BfAtomComposite& findName, int numGeneric
((typeDef->IsGlobalsContainer()) && ((flags & BfFindTypeDefFlag_AllowGlobal) == 0)))
{
bool handled = false;
if (itr.mCurEntry < mTypeDefs.mPartialSkipCache.mSize)
if ((itr.mCurEntry < mTypeDefs.mPartialSkipCache.mSize) && (!allowGlobal))
{
auto& entry = mTypeDefs.mPartialSkipCache[itr.mCurEntry];
if (entry.mRevision == mTypeDefs.mRevision)
@ -2582,7 +2584,7 @@ BfTypeDef* BfSystem::FindTypeDef(const BfAtomComposite& findName, int numGeneric
}
}
if ((partialStartEntryIdx != -1) && ((flags & BfFindTypeDefFlag_AllowGlobal) == 0))
if ((partialStartEntryIdx != -1) && (!allowGlobal))
{
mTypeDefs.SetPartialSkipCache(partialStartEntryIdx, itr.mCurEntry);
partialStartEntryIdx = -1;
@ -2613,7 +2615,7 @@ BfTypeDef* BfSystem::FindTypeDef(const BfAtomComposite& findName, int numGeneric
itr.MoveToNextHashMatch();
}
if ((partialStartEntryIdx != -1) && ((flags & BfFindTypeDefFlag_AllowGlobal) == 0))
if ((partialStartEntryIdx != -1) && (!allowGlobal))
mTypeDefs.SetPartialSkipCache(partialStartEntryIdx, -1);
}