From: Florian Krohm Date: Sun, 14 Sep 2014 07:40:19 +0000 (+0000) Subject: ML_(dinfo_zalloc/strdup) never return NULL. Remove pointless X-Git-Tag: svn/VALGRIND_3_11_0~998 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5cab944692697dc11ccfbb21061d326dd765e702;p=thirdparty%2Fvalgrind.git ML_(dinfo_zalloc/strdup) never return NULL. Remove pointless asserts at call sites. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14534 --- diff --git a/coregrind/m_debuginfo/priv_misc.h b/coregrind/m_debuginfo/priv_misc.h index 53998b23e5..4031e177e9 100644 --- a/coregrind/m_debuginfo/priv_misc.h +++ b/coregrind/m_debuginfo/priv_misc.h @@ -38,7 +38,8 @@ #include "pub_core_basics.h" // SizeT -/* Allocate(zeroed), free, strdup, memdup, shrink, all in VG_AR_DINFO. */ +/* Allocate(zeroed), free, strdup, memdup, shrink, all in VG_AR_DINFO. + The allocation functions never return NULL. */ void* ML_(dinfo_zalloc)( const HChar* cc, SizeT szB ); void ML_(dinfo_free)( void* v ); HChar* ML_(dinfo_strdup)( const HChar* cc, const HChar* str ); diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c index cf1d7239ed..a319bf31cd 100644 --- a/coregrind/m_debuginfo/readdwarf3.c +++ b/coregrind/m_debuginfo/readdwarf3.c @@ -632,7 +632,6 @@ static GExpr* make_singleton_GX ( DiCursor block, ULong nbytes ) gx = ML_(dinfo_zalloc)( "di.readdwarf3.msGX.1", sizeof(GExpr) + bytesReqd ); - vg_assert(gx); p = pstart = &gx->payload[0]; @@ -747,7 +746,6 @@ static GExpr* make_general_GX ( CUConst* cc, vg_assert(nbytes >= 1); gx = ML_(dinfo_zalloc)( "di.readdwarf3.mgGX.2", sizeof(GExpr) + nbytes ); - vg_assert(gx); VG_(memcpy)( &gx->payload[0], (UChar*)VG_(indexXA)(xa,0), nbytes ); vg_assert( &gx->payload[nbytes] == ((UChar*)gx) + sizeof(GExpr) + nbytes ); @@ -3451,7 +3449,6 @@ static void parse_type_DIE ( /*MOD*/XArray* /* of TyEnt */ tyents, fieldE.Te.Field.name = ML_(dinfo_strdup)( "di.readdwarf3.ptD.member.3", "" ); - vg_assert(fieldE.Te.Field.name); if (fieldE.Te.Field.typeR == D3_INVALID_CUOFF) goto_bad_DIE; if (fieldE.Te.Field.nLoc) { diff --git a/coregrind/m_debuginfo/readpdb.c b/coregrind/m_debuginfo/readpdb.c index 011c1dac11..01b57ac474 100644 --- a/coregrind/m_debuginfo/readpdb.c +++ b/coregrind/m_debuginfo/readpdb.c @@ -2448,7 +2448,6 @@ HChar* ML_(find_name_of_pdb_file)( HChar* pename ) + VG_(strlen)(egrep) + VG_(strlen)(tmpname) + 100/*misc*/; HChar* cmd = ML_(dinfo_zalloc)("di.readpe.fnopf.cmd", cmdlen); - vg_assert(cmd); VG_(sprintf)(cmd, "%s -c \"%s '%s' | %s '\\.pdb|\\.PDB' >> %s\"", sh, strings, pename, egrep, tmpname); vg_assert(cmd[cmdlen-1] == 0); @@ -2484,7 +2483,6 @@ HChar* ML_(find_name_of_pdb_file)( HChar* pename ) } HChar* pdbname = ML_(dinfo_zalloc)("di.readpe.fnopf.pdbname", szB + 1); - vg_assert(pdbname); pdbname[szB] = 0; Int nread = VG_(read)(fd, pdbname, szB);