Skip to content

Commit

Permalink
Uncommented the CLR_RT_TypeSystem::FindTypeDef functionality (#847)
Browse files Browse the repository at this point in the history
That fixes issue #397
Why was that commented out?

Signed-off-by: Matthias Jentsch <[email protected]>
  • Loading branch information
MatthiasJentsch authored Sep 9, 2018
1 parent 0336b97 commit 9810be0
Showing 1 changed file with 62 additions and 62 deletions.
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

0 comments on commit 9810be0

Please sign in to comment.