[all-commits] [llvm/llvm-project] 35fd37: llvm-symbolizer: Don't crash when referencing an i...

David Blaikie via All-commits all-commits at lists.llvm.org
Mon Mar 13 17:51:54 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 35fd37177b9b201f26390fe963767be548c8c2e9
      https://github.com/llvm/llvm-project/commit/35fd37177b9b201f26390fe963767be548c8c2e9
  Author: David Blaikie <dblaikie at gmail.com>
  Date:   2023-03-14 (Tue, 14 Mar 2023)

  Changed paths:
    M llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp

  Log Message:
  -----------
  llvm-symbolizer: Don't crash when referencing an invalid CU in a dwp file twice

Previously we'd stash a null pointer in a sorted vector of CUs - the
next time around, we'd try to do a binary search in that vector (sorting
on a key inside the objects pointed to by the elements of the vector)
which would deref null if we'd stashed a null in there previously.

As a reasonable, but not ideal, workaround - don't stash any result in
the vector - this means every query will produce a new warning
(resulting in duplicate warnings) but better than a crash.

Stashing null in the list could be workable if we also stashed the
offset in a pair - but then all the clients would need to be fixed up
(maybe using a filtering iterator) which seems like overkill for this
uncommon error case.




More information about the All-commits mailing list