]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* dwarf2read.c (dwarf2_symbol_mark_computed): Handle corrupted
authorJoel Brobecker <brobecker@gnat.com>
Thu, 20 Jul 2006 16:17:18 +0000 (16:17 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Thu, 20 Jul 2006 16:17:18 +0000 (16:17 +0000)
        or missing location list information.  Suggested by Jan
        Kratochvil <lace@jankratochvil.net>.

gdb/ChangeLog
gdb/dwarf2read.c

index 0a59c338a0a7bc8aafa6377550a2b45d5ccc3035..80864d7b55f809565707252cc48e2f3fb4fc0a1d 100644 (file)
@@ -1,3 +1,9 @@
+2006-07-20  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * dwarf2read.c (dwarf2_symbol_mark_computed): Handle corrupted
+       or missing location list information.  Suggested by Jan
+       Kratochvil <lace@jankratochvil.net>.
+
 2006-07-13  Denis PILAT  <denis.pilat@st.com>
 
        * interps.c (interpreter_completer): Allocate one more item to the
index 31b0ae0b65b650b311682cc56709d1f11d0244b8..5324329dcd949382b403ebd11263e058b266a3fc 100644 (file)
@@ -9304,7 +9304,11 @@ static void
 dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym,
                             struct dwarf2_cu *cu)
 {
-  if (attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8)
+  if ((attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8)
+      /* ".debug_loc" may not exist at all, or the offset may be outside
+        the section.  If so, fall through to the complaint in the
+        other branch.  */
+      && DW_UNSND (attr) < dwarf2_per_objfile->loc_size)
     {
       struct dwarf2_loclist_baton *baton;