Skip to content

Commit

Permalink
reove bad interface check
Browse files Browse the repository at this point in the history
  • Loading branch information
rainers committed Jun 10, 2018
1 parent b792d65 commit 5d258bd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 20 deletions.
25 changes: 9 additions & 16 deletions DebugEngine/MagoNatDE/DRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ namespace Mago
mCoreProc( coreProcess ),
mPtrSize( 0 ),
mAAVersion( -1 ),
mClassInfoVtblAddr( 0 ),
mInterfaceInfoVtblAddr( 0 )
mClassInfoVtblAddr( 0 )
{
_ASSERT( debugger != NULL );
_ASSERT( coreProcess != NULL );
Expand Down Expand Up @@ -1010,26 +1009,24 @@ namespace Mago
hr = ReadAddress( vtbl, 0, classinfo );
if ( SUCCEEDED( hr ) )
{
if( mClassInfoVtblAddr && mInterfaceInfoVtblAddr )
{
hr = ReadAddress( classinfo, 0, ci_vtbl );
if ( FAILED( hr ) )
return hr;
if( ci_vtbl != mClassInfoVtblAddr && ci_vtbl != mInterfaceInfoVtblAddr )
return E_FAIL;
}

TypeInfo_Class64 ti;
hr = ReadTypeInfoClass( classinfo, ti );
if ( SUCCEEDED( hr ) )
{
if (checkInterface && ti.init.ptr < 0x10000 )
if ( checkInterface && ti.init.ptr < 0x10000 )
{
// emulate _d_toObject() for interfaces
addr = addr - ti.init.ptr;
checkInterface = false;
goto L_retryInterface;
}
if( mClassInfoVtblAddr )
{
// verify class info vtbl pointer
if( ti.pvtbl != mClassInfoVtblAddr )
return E_FAIL;
}

if ( ti.name.length < 4096 )
{
char* buf = new char[(size_t) ti.name.length];
Expand Down Expand Up @@ -1173,9 +1170,5 @@ namespace Mago
{
mClassInfoVtblAddr = addr;
}
void DRuntime::SetInterfaceInfoVtblAddr(Address64 addr)
{
mInterfaceInfoVtblAddr = addr;
}

}
2 changes: 0 additions & 2 deletions DebugEngine/MagoNatDE/DRuntime.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace Mago
int mPtrSize;
int mAAVersion;
Address64 mClassInfoVtblAddr;
Address64 mInterfaceInfoVtblAddr;

public:
DRuntime( IDebuggerProxy* debugger, ICoreProcess* coreProcess );
Expand All @@ -38,7 +37,6 @@ namespace Mago
int GetAAVersion() const { return mAAVersion; }

void SetClassInfoVtblAddr(Address64 addr);
void SetInterfaceInfoVtblAddr( Address64 addr );

virtual HRESULT GetValue(
MagoEE::Address aArrayAddr,
Expand Down
2 changes: 0 additions & 2 deletions DebugEngine/MagoNatDE/Program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,6 @@ namespace Mago

if ( FindGlobalSymbolAddress( mod, "_D14TypeInfo_Class6__vtblZ", addr ) )
mDRuntime->SetClassInfoVtblAddr( addr );
if ( FindGlobalSymbolAddress( mod, "_D18TypeInfo_Interface6__vtblZ", addr ) )
mDRuntime->SetInterfaceInfoVtblAddr( addr );
}
}

Expand Down

0 comments on commit 5d258bd

Please sign in to comment.