forked from OSchip/llvm-project
Re-land "[PDB] Avoid calling discoverTypeIndices for a known record kind"
Fixed bad usage of slice API causing assertion failures. Reverts810c8e9b49
Reinstatesbd7ea8641e
This commit is contained in:
parent
5070cecd72
commit
1e5793345b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue