From 2e71b5714df37470cbfa44eb1faefd4e1bc22648 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 31 Oct 2018 11:59:34 +0100 Subject: [PATCH] Fix hash-table violation in trans-decl.c. 2018-10-31 Martin Liska * trans-decl.c (struct module_hasher): Call htab_hash_string for s->name and not for s. From-SVN: r265663 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/trans-decl.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 1186a40e4b5..e6e350d8bd1 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2018-10-31 Martin Liska + + * trans-decl.c (struct module_hasher): Call htab_hash_string + for s->name and not for s. + 2018-10-30 Thomas Koenig PR fortran/85896 diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 88f9f570725..83cbcd123fe 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -4825,7 +4825,11 @@ struct module_hasher : ggc_ptr_hash { typedef const char *compare_type; - static hashval_t hash (module_htab_entry *s) { return htab_hash_string (s); } + static hashval_t hash (module_htab_entry *s) + { + return htab_hash_string (s->name); + } + static bool equal (module_htab_entry *a, const char *b) { -- 2.30.2