[all-commits] [llvm/llvm-project] 314a0d: Fix crash after looking up dwo_id=0 in CU index.
Jorge Gorbe Moya via All-commits
all-commits at lists.llvm.org
Thu Nov 19 11:15:29 PST 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 314a0d73a8444e3b0c1a0d0de7d615d9448af1c9
https://github.com/llvm/llvm-project/commit/314a0d73a8444e3b0c1a0d0de7d615d9448af1c9
Author: Jorge Gorbe Moya <jgorbe at google.com>
Date: 2020-11-19 (Thu, 19 Nov 2020)
Changed paths:
M llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp
A llvm/test/tools/llvm-symbolizer/split-dwarf-zero-signature-not-found.s
Log Message:
-----------
Fix crash after looking up dwo_id=0 in CU index.
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 cause the lookup to fail and return
a nullptr (as it should), because the empty slot has a 0 in the
signature field, and a pointer to the empty slot will be incorrectly
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.
Differential Revision: https://reviews.llvm.org/D91670
More information about the All-commits
mailing list