Skip to content

Commit

Permalink
Re-land "[PDB] Avoid calling discoverTypeIndices for a known record k…
Browse files Browse the repository at this point in the history
…ind"

Fixed bad usage of slice API causing assertion failures.

Reverts 810c8e9
Reinstates bd7ea86
  • Loading branch information
rnk committed May 3, 2020
1 parent 5070cec commit 1e57933
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lld/COFF/PDB.cpp
Expand Up @@ -726,10 +726,9 @@ static void translateIdSymbols(MutableArrayRef<uint8_t> &recordData,
// in both cases we just need the second type index.
if (!ti->isSimple() && !ti->isNoneType()) {
CVType funcIdData = iDTable.getType(*ti);
SmallVector<TypeIndex, 2> indices;
discoverTypeIndices(funcIdData, indices);
assert(indices.size() == 2);
*ti = indices[1];
ArrayRef<uint8_t> tiBuf = funcIdData.data().slice(8, 4);
assert(tiBuf.size() == 4 && "corruct LF_[MEM]FUNC_ID record");
*ti = *reinterpret_cast<const TypeIndex *>(tiBuf.data());
}

kind = (kind == SymbolKind::S_GPROC32_ID) ? SymbolKind::S_GPROC32
Expand Down

0 comments on commit 1e57933

Please sign in to comment.