Skip to content

Commit 05faf5e

Browse files
committed
Fix crawling of types in FindTypeDef
- Was comparing against the wrong value. - Added extra check for valid enclosing type before moving forward.
1 parent d7fe889 commit 05faf5e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/CLR/Core/TypeSystem.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4363,9 +4363,14 @@ bool CLR_RT_Assembly::FindTypeDef(const char *typeName, CLR_INDEX scope, CLR_RT_
43634363

43644364
for (int i = 0; i < tblSize; i++, target++)
43654365
{
4366-
auto enclosingType = target->EnclosingType();
4366+
if (!target->HasValidEnclosingType())
4367+
{
4368+
continue;
4369+
}
4370+
4371+
CLR_INDEX enclosingTypeIndex = target->EnclosingTypeIndex();
43674372

4368-
if (enclosingType == scope)
4373+
if (enclosingTypeIndex == scope)
43694374
{
43704375
const char *szName = GetString(target->name);
43714376

0 commit comments

Comments
 (0)