[DebugInfo][COFF] Fix reading variable-length encoded records
authorAlexandre Ganea <alexandre.ganea@ubisoft.com>
Tue, 10 Apr 2018 01:58:45 +0000 (01:58 +0000)
committerAlexandre Ganea <alexandre.ganea@ubisoft.com>
Tue, 10 Apr 2018 01:58:45 +0000 (01:58 +0000)
commit08df84e4f022d09cf58ea9d11ed1ce4b104a64e9
tree05d03a5c6d9da12ef08ec855bc9fc61648a5712b
parent76a0154ce5cd60172ded3479bddfdf198b1dddf9
[DebugInfo][COFF] Fix reading variable-length encoded records

While reading Codeview records which contain variable-length encoded integers,
such as LF_BCLASS, LF_ENUMERATE, LF_MEMBER, LF_VBCLASS or LF_IVBCLASS,
the record's size would be improperly calculated in cases where the value was
indeed of a variable length (>= LF_NUMERIC). This caused a bad alignement on
the next record, which would/might crash later on.

Differential Revision: https://reviews.llvm.org/D45104

llvm-svn: 329659
llvm/lib/DebugInfo/CodeView/TypeIndexDiscovery.cpp
llvm/unittests/DebugInfo/CodeView/TypeIndexDiscoveryTest.cpp