|
From: <sv...@va...> - 2005-05-12 09:04:08
|
Author: sewardj
Date: 2005-05-12 10:04:06 +0100 (Thu, 12 May 2005)
New Revision: 3676
Modified:
trunk/memcheck/mac_leakcheck.c
Log:
When constructing a LeakErr, the (Char*) .string field is abused to
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.
=20
Modified: trunk/memcheck/mac_leakcheck.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/mac_leakcheck.c 2005-05-12 08:27:04 UTC (rev 3675)
+++ trunk/memcheck/mac_leakcheck.c 2005-05-12 09:04:06 UTC (rev 3676)
@@ -494,7 +494,10 @@
Unreached =3D=3D p_min->loss_mode || Interior =3D=3D p_min->los=
s_mode );
is_suppressed =3D=20
VG_(unique_error) ( tid, LeakErr, (UInt)i+1,
- (Char*)n_lossrecords, (void*) p_min,
+ /* HACK ALERT */
+ ULong_to_Ptr((ULong)(UInt)n_lossrecords),=20
+ /* end HACK ALERT */
+ (void*) p_min,
p_min->allocated_at, print_record,
/*allow_GDB_attach*/False, /*count_error*/F=
alse );
=20
|