|
From: <sv...@va...> - 2006-10-04 02:02:55
|
Author: sewardj
Date: 2006-10-04 03:02:43 +0100 (Wed, 04 Oct 2006)
New Revision: 6167
Log:
Fix wraparound error in assertion.
Modified:
branches/AIX5/coregrind/m_initimg/initimg-aix5.c
Modified: branches/AIX5/coregrind/m_initimg/initimg-aix5.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
--- branches/AIX5/coregrind/m_initimg/initimg-aix5.c 2006-10-04 01:36:55 =
UTC (rev 6166)
+++ branches/AIX5/coregrind/m_initimg/initimg-aix5.c 2006-10-04 02:02:43 =
UTC (rev 6167)
@@ -178,6 +178,8 @@
+ (have_ld_pre ? ld_pre_len : 0)
+ errmsg_len;
szPG =3D VG_PGROUNDUP(szB+1) / VKI_PAGE_SIZE;
+ VG_(debugLog)(2, "initimg", "preload page size: %d bytes, %d pages\n"=
, szB, szPG);
+
vg_assert(szB > 0);
vg_assert(szB < szPG * VKI_PAGE_SIZE);
=20
@@ -190,6 +192,8 @@
"for preload info");
pp =3D (AIX5PreloadPage*)sres.res;
=20
+ VG_(debugLog)(2, "initimg", "preload page allocation succeeded at %p\=
n", pp);
+
/* Zero out the initial structure. */
VG_(memset)(pp, 0, sizeof(AIX5PreloadPage));
=20
@@ -212,7 +216,7 @@
pp->off_errmsg =3D pc - (UChar*)pp;
pp->len_errmsg =3D errmsg_len - 1; /* -1: skip terminating NUL */
=20
- vg_assert(pc < ((UChar*)pp) + szPG * VKI_PAGE_SIZE);
+ vg_assert(pc <=3D ((UChar*)pp) - 1 + szPG * VKI_PAGE_SIZE);
=20
VG_(free)(plcore_str);
VG_(free)(pltool_str);
|