PATCH: large int / alias

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

The *(ptrtypeA*)&var_type_B construct is illegal and will confuse
newer gccs, it violates 'strict aliasing' constraints.

I verified the generated assembler code.

Ciao, Marcus

Changelog:
	Fixed strict aliasing problem in RtlEnlargedUnsignedDivide.

Index: dlls/ntdll/large_int.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/large_int.c,v
retrieving revision 1.4
diff -u -u -r1.4 large_int.c
--- dlls/ntdll/large_int.c	12 Sep 2002 22:07:03 -0000	1.4
+++ dlls/ntdll/large_int.c	17 Nov 2002 22:40:51 -0000
@@ -141,10 +141,14 @@
 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


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux