]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Merge vx1501 (strict-aliasing fix)
authorJulian Seward <jseward@acm.org>
Tue, 27 Dec 2005 14:35:15 +0000 (14:35 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 27 Dec 2005 14:35:15 +0000 (14:35 +0000)
git-svn-id: svn://svn.valgrind.org/vex/branches/VEX_3_1_BRANCH@1516

VEX/priv/ir/irdefs.c

index fe6c9a4ce4b916f4c0ee9708433b2efacc32067f..5816f0f39143f0343be1dbbb64b620cc22c4233f 100644 (file)
@@ -75,13 +75,16 @@ void ppIRType ( IRType ty )
 
 void ppIRConst ( IRConst* con )
 {
+   vassert(sizeof(ULong) == sizeof(Double));
+   union { ULong i64; Double f64; } u;
    switch (con->tag) {
       case Ico_U1:   vex_printf( "%d:I1",        con->Ico.U1 ? 1 : 0); break;
       case Ico_U8:   vex_printf( "0x%x:I8",      (UInt)(con->Ico.U8)); break;
       case Ico_U16:  vex_printf( "0x%x:I16",     (UInt)(con->Ico.U16)); break;
       case Ico_U32:  vex_printf( "0x%x:I32",     (UInt)(con->Ico.U32)); break;
       case Ico_U64:  vex_printf( "0x%llx:I64",   (ULong)(con->Ico.U64)); break;
-      case Ico_F64:  vex_printf( "F64{0x%llx}",  *(ULong*)(&con->Ico.F64));
+      case Ico_F64:  u.f64 = con->Ico.F64;
+                     vex_printf( "F64{0x%llx}",  u.i64);
                      break;
       case Ico_F64i: vex_printf( "F64i{0x%llx}", con->Ico.F64i); break;
       case Ico_V128: vex_printf( "V128{0x%04x}", (UInt)(con->Ico.V128)); break;