]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Check that operand of DW_LNE_set_address is != 0
authorPetr Machata <pmachata@redhat.com>
Sat, 19 Mar 2011 10:55:07 +0000 (11:55 +0100)
committerPetr Machata <pmachata@redhat.com>
Sat, 19 Mar 2011 10:55:07 +0000 (11:55 +0100)
dwarflint/check_debug_line.cc

index ec8153baa9f2931c8eb6c0116af267a2ca8f0cc1..77ee6ebecc594123cd89bf380b82e6791ddaf3b8 100644 (file)
@@ -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;
                    }