* dwarf2read.c (recursively_find_pc_sect_symtab): Initialize "s"
authorDoug Evans <dje@google.com>
Sun, 20 May 2012 17:15:29 +0000 (17:15 +0000)
committerDoug Evans <dje@google.com>
Sun, 20 May 2012 17:15:29 +0000 (17:15 +0000)
before use.  Check for symtab->includes == NULL before scanning it.

gdb/ChangeLog
gdb/dwarf2read.c

index 615b8354057f961506b3d8a9449fc63489ea74a6..e686fb5aa91ab57016adc038395e4be3b7f4f832 100644 (file)
@@ -1,3 +1,8 @@
+2012-05-20  Doug Evans  <dje@google.com>
+
+       * dwarf2read.c (recursively_find_pc_sect_symtab): Initialize "s"
+       before use.  Check for symtab->includes == NULL before scanning it.
+
 2012-05-18  Maciej W. Rozycki  <macro@codesourcery.com>
 
        * mips-tdep.c (mips_reg3_to_reg): Optimize storage.
index 972917366316deafec1809958fa42a4dfeb3760a..6ddf23657b6bc3a4beb2126e71bd6b571747bc4f 100644 (file)
@@ -3003,9 +3003,12 @@ recursively_find_pc_sect_symtab (struct symtab *symtab, CORE_ADDR pc)
       && blockvector_contains_pc (BLOCKVECTOR (symtab), pc))
     return symtab;
 
+  if (symtab->includes == NULL)
+    return NULL;
+
   for (i = 0; symtab->includes[i]; ++i)
     {
-      struct symtab *s;
+      struct symtab *s = symtab->includes[i];
 
       s = recursively_find_pc_sect_symtab (s, pc);
       if (s != NULL)