Fix an incorrect comment. Add asserts.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14896 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c
index 9359362..d397883 100644
--- a/coregrind/m_aspacemgr/aspacemgr-linux.c
+++ b/coregrind/m_aspacemgr/aspacemgr-linux.c
@@ -2737,14 +2737,14 @@
return True;
}
-/* 'seg' must be NULL or have been obtained from
- VG_(am_find_nsegment), and still valid. If non-NULL, and if it
- denotes a SkAnonC (anonymous client mapping) area, set the .isCH
+/* 'seg' must have been obtained from VG_(am_find_nsegment), and still valid.
+ If it denotes a SkAnonC (anonymous client mapping) area, set the .isCH
(is-client-heap) flag for that area. Otherwise do nothing.
(Bizarre interface so that the same code works for both Linux and
AIX and does not impose inefficiencies on the Linux version.) */
void VG_(am_set_segment_isCH_if_SkAnonC)( const NSegment* seg )
{
+ aspacem_assert(seg != NULL);
Int i = segAddr_to_index( seg );
aspacem_assert(i >= 0 && i < nsegments_used);
if (nsegments[i].kind == SkAnonC) {
@@ -2759,6 +2759,7 @@
segment. */
void VG_(am_set_segment_hasT_if_SkFileC_or_SkAnonC)( const NSegment* seg )
{
+ aspacem_assert(seg != NULL);
Int i = segAddr_to_index( seg );
aspacem_assert(i >= 0 && i < nsegments_used);
if (nsegments[i].kind == SkAnonC || nsegments[i].kind == SkFileC) {
@@ -2850,6 +2851,7 @@
/* Find the segment array index for SEG. If the assertion fails it
probably means you passed in a bogus SEG. */
+ aspacem_assert(seg != NULL);
segA = segAddr_to_index( seg );
aspacem_assert(segA >= 0 && segA < nsegments_used);