aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2018-11-02 07:55:49 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2018-11-02 07:55:49 +0000
commitea7e39004f444a9f019631b2c5de4d56ffc9c71b (patch)
tree256e747ba9b07910a77af8c34d446c0824a9aaaa /gcc/dwarf2out.c
parenta412de98913cab0f80cfb023da8138fc5297c1e3 (diff)
downloadgcc-ea7e39004f444a9f019631b2c5de4d56ffc9c71b.zip
gcc-ea7e39004f444a9f019631b2c5de4d56ffc9c71b.tar.gz
gcc-ea7e39004f444a9f019631b2c5de4d56ffc9c71b.tar.bz2
dwarf2out.c (build_abbrev_table): Guard lookup_external_ref call with is_type_die.
2018-11-02 Richard Biener <rguenther@suse.de> * dwarf2out.c (build_abbrev_table): Guard lookup_external_ref call with is_type_die. From-SVN: r265740
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 30bbfee..8b478aa 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. */