m_xarray.c:133:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
(I have double checked that passing a negative argument makes the
assert fail)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15232
inline void* VG_(indexXA) ( const XArray* xa, Word n )
{
vg_assert(xa);
- // vg_assert(n >= 0); If n negative, the UWord conversion will make
- // it bigger than usedsizeE.
- vg_assert((UWord)n < xa->usedsizeE);
+ /* vg_assert(n >= 0); If n negative, the UWord conversion will make
+ it bigger than usedsizeE, which is verified to be non negative when
+ xa is modified. */
+ vg_assert((UWord)n < (UWord)xa->usedsizeE);
return ((char*)xa->arr) + n * xa->elemSzB;
}