aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2012-05-03 05:27:36 +0000
committerDoug Evans <dje@google.com>2012-05-03 05:27:36 +0000
commit943cb7566b4dbb46059e5d5b2f7968e8b3364c88 (patch)
tree6f46baedbcf08c21c2b668a4ecf21da342b87e18 /gdb/dwarf2read.c
parent2d4e03767f097cc306d9fbba613f8a8f4328b4ae (diff)
downloadgdb-943cb7566b4dbb46059e5d5b2f7968e8b3364c88.zip
gdb-943cb7566b4dbb46059e5d5b2f7968e8b3364c88.tar.gz
gdb-943cb7566b4dbb46059e5d5b2f7968e8b3364c88.tar.bz2
* dwarf2read.c (dw2_find_symbol_file): Don't crash if there are no files.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 0caa5f9..412fe5b 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -2833,7 +2833,8 @@ dw2_find_symbol_file (struct objfile *objfile, const char *name)
per_cu = dw2_get_cu (MAYBE_SWAP (vec[1]));
file_data = dw2_get_file_names (objfile, per_cu);
- if (file_data == NULL)
+ if (file_data == NULL
+ || file_data->num_file_names == 0)
return NULL;
return file_data->file_names[file_data->num_file_names - 1];