From ea7e39004f444a9f019631b2c5de4d56ffc9c71b Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Fri, 2 Nov 2018 07:55:49 +0000 Subject: [PATCH] dwarf2out.c (build_abbrev_table): Guard lookup_external_ref call with is_type_die. 2018-11-02 Richard Biener * dwarf2out.c (build_abbrev_table): Guard lookup_external_ref call with is_type_die. From-SVN: r265740 --- gcc/ChangeLog | 5 +++++ gcc/dwarf2out.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 90d11f5038d..9b583eea0bd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-11-02 Richard Biener + + * dwarf2out.c (build_abbrev_table): Guard lookup_external_ref call + with is_type_die. + 2018-11-02 Richard Biener PR tree-optimization/87776 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 30bbfee9052..8b478aa265f 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -9023,8 +9023,9 @@ build_abbrev_table (dw_die_ref die, external_ref_hash_type *extern_map) struct external_ref *ref_p; gcc_assert (AT_ref (a)->comdat_type_p || AT_ref (a)->die_id.die_symbol); - ref_p = lookup_external_ref (extern_map, c); - if (ref_p->stub && ref_p->stub != die) + if (is_type_die (c) + && (ref_p = lookup_external_ref (extern_map, c)) + && ref_p->stub && ref_p->stub != die) change_AT_die_ref (a, ref_p->stub); else /* We aren't changing this reference, so mark it external. */ -- 2.30.2