From d0aef218a043414b039a5817be2251a198409f21 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Mon, 18 Nov 2002 19:49:18 +0000 Subject: [PATCH] Fixed strict aliasing problem in RtlEnlargedUnsignedDivide. --- dlls/ntdll/large_int.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/large_int.c b/dlls/ntdll/large_int.c index 7aee5edd8ac..9f50de70f89 100644 --- a/dlls/ntdll/large_int.c +++ b/dlls/ntdll/large_int.c @@ -141,10 +141,14 @@ ULONGLONG WINAPI RtlEnlargedUnsignedMultiply( UINT a, UINT b ) UINT WINAPI RtlEnlargedUnsignedDivide( ULONGLONG a, UINT b, UINT *remptr ) { #if defined(__i386__) && defined(__GNUC__) - UINT ret, rem; + UINT ret, rem, p1, p2; + + p1 = a >> 32; + p2 = a & 0xffffffffLL; + __asm__("div %4,%%eax" : "=a" (ret), "=d" (rem) - : "0" (*(UINT*)&a), "1" (*((UINT*)&a+1)), "g" (b) ); + : "0" (p2), "1" (p1), "g" (b) ); if (remptr) *remptr = rem; return ret; #else