]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
ML_(dinfo_zalloc/strdup) never return NULL. Remove pointless
authorFlorian Krohm <florian@eich-krohm.de>
Sun, 14 Sep 2014 07:40:19 +0000 (07:40 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Sun, 14 Sep 2014 07:40:19 +0000 (07:40 +0000)
asserts at call sites.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14534

coregrind/m_debuginfo/priv_misc.h
coregrind/m_debuginfo/readdwarf3.c
coregrind/m_debuginfo/readpdb.c

index 53998b23e5820afb3a589cb4ee27cd327a3cc57a..4031e177e9ef7a7623071f6eb563fc002599415b 100644 (file)
@@ -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 );
index cf1d7239edf9735264f455af84c84fae3d9ec5ae..a319bf31cd7683409283e8a78607f319187cebb8 100644 (file)
@@ -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",
                                  "<anon_field>" );
-      vg_assert(fieldE.Te.Field.name);
       if (fieldE.Te.Field.typeR == D3_INVALID_CUOFF)
          goto_bad_DIE;
       if (fieldE.Te.Field.nLoc) {
index 011c1dac11ac02bc890e160b4daed3af3045e125..01b57ac4746e94cdb241788e7af28af19e1a400e 100644 (file)
@@ -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);