diff options
author | Petr Machata <pmachata@redhat.com> | 2011-03-19 11:55:07 +0100 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2011-03-19 11:55:07 +0100 |
commit | 8990964cf319d4d326d5d510c1f9f5562fb63859 (patch) | |
tree | b3b1dfcd5b9fd87dff174a9ee5f0443efc9cfe21 | |
parent | c56740aafd46405f84e0419b7059ca6fa2500320 (diff) | |
download | elfutils-8990964cf319d4d326d5d510c1f9f5562fb63859.tar.gz |
dwarflint: Check that operand of DW_LNE_set_address is != 0
-rw-r--r-- | dwarflint/check_debug_line.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/dwarflint/check_debug_line.cc b/dwarflint/check_debug_line.cc index ec8153ba..77ee6ebe 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; } |