aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarfread.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1992-08-12 18:17:48 +0000
committerFred Fish <fnf@specifix.com>1992-08-12 18:17:48 +0000
commit7b5d965008fee110409d054a787a7d825bc44436 (patch)
tree834ee0f20477b37bf8885c14ebea7cb94436aa40 /gdb/dwarfread.c
parenta00721fc4a008ab916883559397d635e28f1fd1a (diff)
downloadgdb-7b5d965008fee110409d054a787a7d825bc44436.zip
gdb-7b5d965008fee110409d054a787a7d825bc44436.tar.gz
gdb-7b5d965008fee110409d054a787a7d825bc44436.tar.bz2
* buildsym.c (end_symtab): Document that end_symtab can return
NULL under non-error conditions. * dwarfread.c (read_file_scope): Guard against dereferencing NULL returned from end_symtab for empty compilation units.
Diffstat (limited to 'gdb/dwarfread.c')
-rw-r--r--gdb/dwarfread.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c
index c16c21a..fcca11c 100644
--- a/gdb/dwarfread.c
+++ b/gdb/dwarfread.c
@@ -1662,19 +1662,22 @@ read_file_scope (dip, thisdie, enddie, objfile)
decode_line_numbers (lnbase);
process_dies (thisdie + dip -> die_length, enddie, objfile);
symtab = end_symtab (dip -> at_high_pc, 0, 0, objfile);
- /* FIXME: The following may need to be expanded for other languages */
- switch (dip -> at_language)
+ if (symtab != NULL)
{
- case LANG_C89:
- case LANG_C:
- symtab -> language = language_c;
- break;
- case LANG_C_PLUS_PLUS:
- symtab -> language = language_cplus;
- break;
- default:
- ;
- }
+ /* FIXME: The following may need to be expanded for other languages */
+ switch (dip -> at_language)
+ {
+ case LANG_C89:
+ case LANG_C:
+ symtab -> language = language_c;
+ break;
+ case LANG_C_PLUS_PLUS:
+ symtab -> language = language_cplus;
+ break;
+ default:
+ ;
+ }
+ }
do_cleanups (back_to);
utypes = NULL;
numutypes = 0;