From: Petr Machata Date: Sat, 19 Mar 2011 10:55:07 +0000 (+0100) Subject: dwarflint: Check that operand of DW_LNE_set_address is != 0 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8990964cf319d4d326d5d510c1f9f5562fb63859;p=thirdparty%2Felfutils.git dwarflint: Check that operand of DW_LNE_set_address is != 0 --- diff --git a/dwarflint/check_debug_line.cc b/dwarflint/check_debug_line.cc index ec8153baa..77ee6ebec 100644 --- a/dwarflint/check_debug_line.cc +++ b/dwarflint/check_debug_line.cc @@ -443,9 +443,19 @@ check_debug_line::check_debug_line (checkstack &stack, dwarflint &lint) addr_64 ? 8 : 4, &addr, &where, rel_address, NULL); else if (_m_sec->file.ehdr.e_type == ET_REL) - wr_message (where, cat (mc_impact_2, mc_line, mc_reloc)) - << pri::lacks_relocation ("DW_LNE_set_address") - << '.' << std::endl; + { + wr_message (where, mc_impact_2 | mc_line | mc_reloc) + << pri::lacks_relocation ("DW_LNE_set_address") + << '.' << std::endl; + + // Don't do the addr checking in this case. + break; + } + + if (addr == 0) + wr_message (where, mc_line | mc_impact_1) + << "DW_LNE_set_address with zero operand." + << std::endl; break; }