Fixed bugs with multiple and virtual inheritance
authorPavol Marko <pavolmarko@gmail.com>
Thu Apr 14 16:17:40 2005 +0000 (2005-04-14)
changeset 35a9efd949f83
parent 2 dfa5ea299c33
child 4 25a736308bb4
Fixed bugs with multiple and virtual inheritance
sourcehook/sh_memfuncinfo.h
     1.1 --- a/sourcehook/sh_memfuncinfo.h	Thu Apr 14 13:15:33 2005 +0000
     1.2 +++ b/sourcehook/sh_memfuncinfo.h	Thu Apr 14 16:17:40 2005 +0000
     1.3 @@ -137,7 +137,7 @@
     1.4  		{
     1.5  			out.vtblindex = MFI_GetVtblOffset(*(void**)&mfp);
     1.6  			out.isVirtual = out.vtblindex >= 0 ? true : false;
     1.7 -			out.thisptr = reinterpret_cast<MSVC_MemFunPtr2*>(&mfp)->delta;
     1.8 +			out.thisptroffs = reinterpret_cast<MSVC_MemFunPtr2*>(&mfp)->delta;
     1.9  			out.vtbloffs = 0;
    1.10  		}
    1.11  	};
    1.12 @@ -165,6 +165,7 @@
    1.13  			out.vtblindex = MFI_GetVtblOffset(*(void**)&mfp);
    1.14  			out.isVirtual = out.vtblindex >= 0 ? true : false;
    1.15  			// This pointer
    1.16 +			/*
    1.17  			union {
    1.18  				MFP func;
    1.19  				GenericClass* (T::*ProbeFunc)();
    1.20 @@ -176,7 +177,6 @@
    1.21  				MicrosoftVirtualMFP s;
    1.22  			} u2;
    1.23  
    1.24 -			printf("%d %d", sizeof(mfp), sizeof(u.ProbeFunc));
    1.25  			// Check that the horrible_cast<>s will work
    1.26  			typedef int ERROR_CantUsehorrible_cast[sizeof(mfp)==sizeof(u.s)
    1.27  				&& sizeof(mfp)==sizeof(u.ProbeFunc)
    1.28 @@ -186,6 +186,8 @@
    1.29  			u2.virtfunc = &GenericVirtualClass::GetThis;
    1.30  			u.s.codeptr = u2.s.codeptr;
    1.31  			out.thisptroffs = (reinterpret_cast<T*>(NULL)->*u.ProbeFunc)();
    1.32 +			*/
    1.33 +			out.thisptroffs = -1;
    1.34  			out.vtbloffs = 0;
    1.35  		}
    1.36  	};