[PATCH] D91670: Fix crash after looking up dwo_id=0 in CU index.

Jorge Gorbe Moya via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 17 17:32:24 PST 2020


jgorbe created this revision.
jgorbe added reviewers: dblaikie, labath.
Herald added subscribers: rupprecht, arphaman, hiraditya.
Herald added a reviewer: jhenderson.
Herald added a project: LLVM.
jgorbe requested review of this revision.
Herald added a subscriber: MaskRay.

In the current state, if getFromHash(0) is called and there's no CU
with dwo_id=0, the lookup will stop at an empty slot, then the check
`Rows[H].getSignature() != S` won't fail, because the empty slot has
a 0 in the signature field, and a pointer to the empty slot will be
returned.

This patch fixes this by using the index field in the hash entry to
check for empty slots: signature = 0 can match a valid hash but
according to the spec the index for an occupied slot will always be
non-zero.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91670

Files:
  llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp
  llvm/test/tools/llvm-symbolizer/split-dwarf-zero-signature-not-found.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91670.305932.patch
Type: text/x-patch
Size: 5612 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201118/22779792/attachment.bin>


More information about the llvm-commits mailing list