bfd/dwarf2.c: fix assertion failure in comp_unit_hash_info
authorMax Filippov <jcmvbkbc@gmail.com>
Thu, 10 Oct 2019 23:37:25 +0000 (16:37 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Fri, 11 Oct 2019 16:02:37 +0000 (09:02 -0700)
stash_maybe_enable_info_hash_tables sets
stash->info_hash_status = STASH_INFO_HASH_ON;
regardless of the result of stash_maybe_update_info_hash_tables call. In
case it fails this results in repeated invocation of comp_unit_hash_info
for the same comp unit and assertion failure in this function.

Only set stash->info_hash_status = STASH_INFO_HASH_ON; when
stash_maybe_update_info_hash_tables is successful.

bfd/
2019-10-11  Max Filippov  <jcmvbkbc@gmail.com>

* dwarf2.c (stash_maybe_enable_info_hash_tables): Only set
stash->info_hash_status = STASH_INFO_HASH_ON when
stash_maybe_update_info_hash_tables succeeds.

bfd/ChangeLog
bfd/dwarf2.c

index 87a6244bca537b5740f5b82a544f03825eaa1115..56f38cfb039e02de4e145f3ffaa36d2b64cccd37 100644 (file)
@@ -1,3 +1,9 @@
+2019-10-11  Max Filippov  <jcmvbkbc@gmail.com>
+
+       * dwarf2.c (stash_maybe_enable_info_hash_tables): Only set
+       stash->info_hash_status = STASH_INFO_HASH_ON when
+       stash_maybe_update_info_hash_tables succeeds.
+
 2019-10-09  Alan Modra  <amodra@gmail.com>
 
        PR 25070
index 88aaa2d23c22c65dd56cc94121a55216f23288cb..75d19aa83750bdaeb215f595b052ff0b1b5dd1cb 100644 (file)
@@ -4231,8 +4231,8 @@ stash_maybe_enable_info_hash_tables (bfd *abfd, struct dwarf2_debug *stash)
   /* We need a forced update so that the info hash tables will
      be created even though there is no compilation unit.  That
      happens if STASH_INFO_HASH_TRIGGER is 0.  */
-  stash_maybe_update_info_hash_tables (stash);
-  stash->info_hash_status = STASH_INFO_HASH_ON;
+  if (stash_maybe_update_info_hash_tables (stash))
+    stash->info_hash_status = STASH_INFO_HASH_ON;
 }
 
 /* Find the file and line associated with a symbol and address using the