Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncommented the CLR_RT_TypeSystem::FindTypeDef functionality #847

Merged
merged 2 commits into from
Sep 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 62 additions & 62 deletions src/CLR/Core/TypeSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3341,84 +3341,84 @@ bool CLR_RT_TypeSystem::FindTypeDef( const char* szClass, CLR_RT_Assembly* assm,
(void)res;

NATIVE_PROFILE_CLR_CORE();
// UNDONE: FIXME
// char rgName [ MAXTYPENAMELEN ];
// char rgNamespace[ MAXTYPENAMELEN ];

char rgName [ MAXTYPENAMELEN ];
char rgNamespace[ MAXTYPENAMELEN ];

// if(hal_strlen_s(szClass) < ARRAYSIZE(rgNamespace))
// {
// const char* szPtr = szClass;
// const char* szPtr_LastDot = NULL;
// const char* szPtr_FirstSubType = NULL;
// char c;
// size_t len;
if(hal_strlen_s(szClass) < ARRAYSIZE(rgNamespace))
{
const char* szPtr = szClass;
const char* szPtr_LastDot = NULL;
const char* szPtr_FirstSubType = NULL;
char c;
size_t len;

// while(true)
// {
// c = szPtr[ 0 ]; if(!c) break;
while(true)
{
c = szPtr[ 0 ]; if(!c) break;

// if(c == '.')
// {
// szPtr_LastDot = szPtr;
// }
// else if(c == '+')
// {
// szPtr_FirstSubType = szPtr;
// break;
// }
if(c == '.')
{
szPtr_LastDot = szPtr;
}
else if(c == '+')
{
szPtr_FirstSubType = szPtr;
break;
}

// szPtr++;
// }
szPtr++;
}

// if(szPtr_LastDot)
// {
// len = szPtr_LastDot++ - szClass ; hal_strncpy_s( rgNamespace, ARRAYSIZE(rgNamespace), szClass , len );
// len = szPtr - szPtr_LastDot; hal_strncpy_s( rgName , ARRAYSIZE(rgName ), szPtr_LastDot, len );
// }
// else
// {
// rgNamespace[ 0 ] = 0;
// hal_strcpy_s( rgName, ARRAYSIZE(rgName), szClass );
// }
if(szPtr_LastDot)
{
len = szPtr_LastDot++ - szClass ; hal_strncpy_s( rgNamespace, ARRAYSIZE(rgNamespace), szClass , len );
len = szPtr - szPtr_LastDot; hal_strncpy_s( rgName , ARRAYSIZE(rgName ), szPtr_LastDot, len );
}
else
{
rgNamespace[ 0 ] = 0;
hal_strcpy_s( rgName, ARRAYSIZE(rgName), szClass );
}


// if(FindTypeDef( rgName, rgNamespace, assm, res ))
// {
// //
// // Found the containing type, let's look for the nested type.
// //
// if(szPtr_FirstSubType)
// {
// CLR_RT_TypeDef_Instance inst;
if(FindTypeDef( rgName, rgNamespace, assm, res ))
{
//
// Found the containing type, let's look for the nested type.
//
if(szPtr_FirstSubType)
{
CLR_RT_TypeDef_Instance inst;

// do
// {
// szPtr = ++szPtr_FirstSubType;
do
{
szPtr = ++szPtr_FirstSubType;

// while(true)
// {
// c = szPtr_FirstSubType[ 0 ]; if(!c) break;
while(true)
{
c = szPtr_FirstSubType[ 0 ]; if(!c) break;

// if(c == '+') break;
if(c == '+') break;

// szPtr_FirstSubType++;
// }
szPtr_FirstSubType++;
}

// len = szPtr_FirstSubType - szPtr; hal_strncpy_s( rgName, ARRAYSIZE(rgName), szPtr, len );
len = szPtr_FirstSubType - szPtr; hal_strncpy_s( rgName, ARRAYSIZE(rgName), szPtr, len );

// inst.InitializeFromIndex( res );
inst.InitializeFromIndex( res );

// if(inst.m_assm->FindTypeDef( rgName, res.Type(), res ) == false)
// {
// return false;
// }
if(inst.m_assm->FindTypeDef( rgName, res.Type(), res ) == false)
{
return false;
}

// } while(c == '+');
// }
} while(c == '+');
}

// return true;
// }
// }
return true;
}
}

res.Clear();

Expand Down