aboutsummaryrefslogtreecommitdiff
path: root/gdb/buildsym.c
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@cygnus>1992-07-14 21:33:39 +0000
committerKen Raeburn <raeburn@cygnus>1992-07-14 21:33:39 +0000
commit23c156a2ade87dc01d0cd98ffdfd886f2a9343b9 (patch)
treee0e68c7163ca22c100ca5f84cbc1eaf7a46c67ce /gdb/buildsym.c
parent7e94a17bcd45a7b125f14f73b42afd9344bfb97a (diff)
downloadgdb-23c156a2ade87dc01d0cd98ffdfd886f2a9343b9.zip
gdb-23c156a2ade87dc01d0cd98ffdfd886f2a9343b9.tar.gz
gdb-23c156a2ade87dc01d0cd98ffdfd886f2a9343b9.tar.bz2
Don't die on TYPE_CODE_UNDEF nodes as base classes.
(Previous checkin died due to cvs bug.)
Diffstat (limited to 'gdb/buildsym.c')
-rw-r--r--gdb/buildsym.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index a3a2f87..5e472b5 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -2690,8 +2690,13 @@ read_struct_type (pp, type, objfile)
{
int i;
for (i = 0; i < TYPE_N_BASECLASSES (type); ++i)
- TYPE_NFN_FIELDS_TOTAL (type) +=
- TYPE_NFN_FIELDS_TOTAL (TYPE_BASECLASS (type, i));
+ {
+ if (TYPE_CODE (TYPE_BASECLASS (type, i)) == TYPE_CODE_UNDEF)
+ /* @@ Memory leak on objfile->type_obstack? */
+ return error_type (pp);
+ TYPE_NFN_FIELDS_TOTAL (type) +=
+ TYPE_NFN_FIELDS_TOTAL (TYPE_BASECLASS (type, i));
+ }
}
for (n = nfn_fields; mainlist; mainlist = mainlist->next) {