Fix crash when creating index from index
[binutils-gdb.git] / gdb / source.c
index 9d9ff4bbc3e993247afca3f8a0bcf20e091e29d1..8691113c729019e1dc9894df7fd30fc9f09f7e17 100644 (file)
@@ -329,7 +329,7 @@ select_source_symtab (struct symtab *s)
       if (sal.symtab == NULL)
        /* We couldn't find the location of `main', possibly due to missing
           line number info, fall back to line 1 in the corresponding file.  */
-       loc->set (symbol_symtab (bsym.symbol), 1);
+       loc->set (bsym.symbol->symtab (), 1);
       else
        loc->set (sal.symtab, std::max (sal.line - (lines_to_list - 1), 1));
       return;