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

Bug#342545: qt-x11-free build fails



tags 342545 patch
thanks

Right, here's an off-the-cuff patch, which gets me past the point of the
SIGBUS on paer.

The same bug exists in the handling of Inf and NaN, but I didn't bother
patching for those since those constants should always be defined on Debian
systems and the related code paths never triggered.

Cheers,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
vorlon@debian.org                                   http://www.debian.org/
diff -u qt-x11-free-3.3.6/debian/changelog qt-x11-free-3.3.6/debian/changelog
--- qt-x11-free-3.3.6/debian/changelog
+++ qt-x11-free-3.3.6/debian/changelog
@@ -1,3 +1,11 @@
+qt-x11-free (3:3.3.6-3.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fix the bogus assumption in src/tools/qlocale.cpp that a char[] can be
+    cast to a double *.  Closes: #342545.
+
+ -- Steve Langasek <vorlon@paer.debian.org>  Thu, 24 Aug 2006 00:17:09 -0600
+
 qt-x11-free (3:3.3.6-3) unstable; urgency=low
 
   +++ Changes by Christopher Martin
only in patch2:
unchanged:
--- qt-x11-free-3.3.6.orig/src/tools/qlocale.cpp
+++ qt-x11-free-3.3.6/src/tools/qlocale.cpp
@@ -122,13 +122,24 @@
 #endif
 
 // We can't rely on -NAN, since all operations on a NAN should return a NAN.
+static double be_neg_nan; 
+static double le_neg_nan;
 static const unsigned char be_neg_nan_bytes[] = { 0xff, 0xf8, 0, 0, 0, 0, 0, 0 };
 static const unsigned char le_neg_nan_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf8, 0xff };
+static bool neg_nan_init = false;
+
 static inline double negNan()
 {
+    if (!neg_nan_init)
+    {
+        memcpy(&be_neg_nan,be_neg_nan_bytes,sizeof(be_neg_nan_bytes));
+        memcpy(&le_neg_nan,le_neg_nan_bytes,sizeof(le_neg_nan_bytes));
+        neg_nan_init = true;
+    }
     return (ByteOrder == BigEndian ?
-            *((const double *) be_neg_nan_bytes) :
-            *((const double *) le_neg_nan_bytes));
+            be_neg_nan : 
+            le_neg_nan);
+            
 }
 
 // Sizes as defined by the ISO C99 standard - fallback

Attachment: signature.asc
Description: Digital signature


Reply to: