@@ -383,21 +383,18 @@ static inline ut64 dwarf_read_offset(bool is_64bit, const ut8 **buf, const ut8 *
383383 if (is_64bit ) {
384384 result = READ64 (* buf );
385385 } else {
386- result = READ32 (* buf );
386+ result = ( ut64 ) READ32 (* buf );
387387 }
388388 return result ;
389389}
390390
391391static inline ut64 dwarf_read_address (size_t size , const ut8 * * buf , const ut8 * buf_end ) {
392392 ut64 result ;
393393 switch (size ) {
394- case 2 :
395- result = READ16 (* buf ); break ;
396- case 4 :
397- result = READ32 (* buf ); break ;
398- case 8 :
399- result = READ64 (* buf ); break ;
400- default :
394+ case 2 : result = READ16 (* buf ); break ;
395+ case 4 : result = READ32 (* buf ); break ;
396+ case 8 : result = READ64 (* buf ); break ;
397+ default :
401398 result = 0 ;
402399 * buf += size ;
403400 eprintf ("Weird dwarf address size: %zu." , size );
@@ -1857,8 +1854,7 @@ static const ut8 *parse_attr_value(const ut8 *obuf, int obuf_len,
18571854 * @param sdb
18581855 * @return const ut8* Updated buffer
18591856 */
1860- static const ut8 * parse_die (const ut8 * buf , const ut8 * buf_end , RBinDwarfAbbrevDecl * abbrev ,
1861- RBinDwarfCompUnitHdr * hdr , RBinDwarfDie * die , const ut8 * debug_str , size_t debug_str_len , Sdb * sdb ) {
1857+ static const ut8 * parse_die (const ut8 * buf , const ut8 * buf_end , RBinDwarfAbbrevDecl * abbrev , RBinDwarfCompUnitHdr * hdr , RBinDwarfDie * die , const ut8 * debug_str , size_t debug_str_len , Sdb * sdb ) {
18621858 size_t i ;
18631859 for (i = 0 ; i < abbrev -> count - 1 ; i ++ ) {
18641860 memset (& die -> attr_values [i ], 0 , sizeof (die -> attr_values [i ]));
@@ -1868,9 +1864,8 @@ static const ut8 *parse_die(const ut8 *buf, const ut8 *buf_end, RBinDwarfAbbrevD
18681864
18691865 RBinDwarfAttrValue * attribute = & die -> attr_values [i ];
18701866
1871- bool is_valid_string_form = (attribute -> attr_form == DW_FORM_strp ||
1872- attribute -> attr_form == DW_FORM_string ) &&
1873- attribute -> string .content ;
1867+ bool is_string = (attribute -> attr_form == DW_FORM_strp || attribute -> attr_form == DW_FORM_string );
1868+ bool is_valid_string_form = is_string && attribute -> string .content ;
18741869 // TODO does this have a purpose anymore?
18751870 // Or atleast it needs to rework becase there will be
18761871 // more comp units -> more comp dirs and only the last one will be kept
@@ -1880,7 +1875,6 @@ static const ut8 *parse_die(const ut8 *buf, const ut8 *buf_end, RBinDwarfAbbrevD
18801875 }
18811876 die -> count ++ ;
18821877 }
1883-
18841878 return buf ;
18851879}
18861880
0 commit comments