]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
When constructing a LeakErr, the (Char*) .string field is abused to
authorJulian Seward <jseward@acm.org>
Thu, 12 May 2005 09:04:06 +0000 (09:04 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 12 May 2005 09:04:06 +0000 (09:04 +0000)
carry an Int.  This is confusing but works on 32-bit platforms; on
64-bit ones, gcc complains about the cast.  This commit adds another
kludge to keep gcc quiet.  Really this should be fixed properly.  The
casting-abuse is 'undone' in case LeakErr in MAC_(pp_Shared_Error).

This should really be fixed properly.  If this .string isn't always
a string, perhaps it should be renamed 'auxword' and turned into a
UWord which is guaranteed castable to/from pointer on any platform.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3676

memcheck/mac_leakcheck.c

index afea0734f735933d84e9d45380432f55e507f87a..c538bfd53010b7abcaa67e1dc51c57a159bc5c13 100644 (file)
@@ -494,7 +494,10 @@ static void full_report(ThreadId tid)
                       Unreached == p_min->loss_mode || Interior == p_min->loss_mode );
       is_suppressed = 
          VG_(unique_error) ( tid, LeakErr, (UInt)i+1,
-                             (Char*)n_lossrecords, (void*) p_min,
+                             /* HACK ALERT */
+                             ULong_to_Ptr((ULong)(UInt)n_lossrecords), 
+                             /* end HACK ALERT */
+                             (void*) p_min,
                              p_min->allocated_at, print_record,
                              /*allow_GDB_attach*/False, /*count_error*/False );