]> granicus.if.org Git - llvm/commit
[llvm-pdbdump] Don't crash when displaying padding.
authorZachary Turner <zturner@google.com>
Fri, 26 May 2017 00:15:15 +0000 (00:15 +0000)
committerZachary Turner <zturner@google.com>
Fri, 26 May 2017 00:15:15 +0000 (00:15 +0000)
commit03783217a0a82d698eced567d3e72a1a6dfd6a81
treebaeb674e282184c386a562f19a841efce4b49cbf
parentf9ebd6114be9f93c9950561bb61c749df02f67af
[llvm-pdbdump] Don't crash when displaying padding.

We have a lot of complicated logic to determine where padding
is in a record, and the debug info doesn't always provide enough
information to figure it out with laser precision.  In this case
we were putting the padding in the wrong place causing an
out of bounds access on a BitVector.

Right now we decide that any trailing padding of a child type
will be truncated during record layout, but this is only true
insofar as the class still is sized properly to end on an
alignment boundary, which the algorithm doesn't yet know about.

For now, just don't crash, even though we display padding twice
in this case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303946 91177308-0d34-0410-b5e6-96231b3b80d8
tools/llvm-pdbdump/PrettyClassLayoutGraphicalDumper.cpp