X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=binutils%2Fdebug.c;h=5470e155edcfe414196516a719c13e9fe11daa92;hb=b25e22fd1698b600310fc56f01b6005b5a3f6227;hp=ee0d62e8ff9218cc3b854ed04d80112088402b94;hpb=8b6efd89a4135971b748c958a852d093b3d79d3d;p=deliverable%2Fbinutils-gdb.git diff --git a/binutils/debug.c b/binutils/debug.c index ee0d62e8ff..5470e155ed 100644 --- a/binutils/debug.c +++ b/binutils/debug.c @@ -1,6 +1,5 @@ /* debug.c -- Handle generic debugging information. - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2005, 2007, - 2009 Free Software Foundation, Inc. + Copyright (C) 1995-2020 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of GNU Binutils. @@ -2420,6 +2419,9 @@ debug_write_type (struct debug_handle *info, int is; const char *tag = NULL; + if (type == DEBUG_TYPE_NULL) + return (*fns->empty_type) (fhandle); + /* If we have a name for this type, just output it. We only output typedef names after they have been defined. We output type tags whenever we are not actually defining them. */ @@ -2482,8 +2484,6 @@ debug_write_type (struct debug_handle *info, debug_error (_("debug_write_type: illegal type encountered")); return FALSE; case DEBUG_KIND_INDIRECT: - if (*type->u.kindirect->slot == DEBUG_TYPE_NULL) - return (*fns->empty_type) (fhandle); return debug_write_type (info, fns, fhandle, *type->u.kindirect->slot, name); case DEBUG_KIND_VOID: @@ -3156,6 +3156,7 @@ debug_type_samep (struct debug_handle *info, struct debug_type_s *t1, && t1->u.krange->upper == t2->u.krange->upper && debug_type_samep (info, t1->u.krange->type, t2->u.krange->type)); + break; case DEBUG_KIND_ARRAY: ret = (t1->u.karray->lower == t2->u.karray->lower @@ -3276,6 +3277,8 @@ debug_class_type_samep (struct debug_handle *info, struct debug_type_s *t1, names, since that sometimes fails in the presence of typedefs and we really don't care. */ if (strcmp (f1->name, f2->name) != 0 + || f1->type == NULL + || f2->type == NULL || ! debug_type_samep (info, debug_get_real_type ((void *) info, f1->type, NULL),