OSDN Git Service

[Object] Fix a crash in Archive::child_iterator's default constructor.
authorLang Hames <lhames@gmail.com>
Wed, 5 Oct 2016 21:20:00 +0000 (21:20 +0000)
committerLang Hames <lhames@gmail.com>
Wed, 5 Oct 2016 21:20:00 +0000 (21:20 +0000)
commit191187346bcd320e2d1b145451aec6a1b75d7a43
tree67ac042b46c58351daa6903e2c767310eed34214
parent8c96de46937060554649f11c599ff6dcccef20bd
[Object] Fix a crash in Archive::child_iterator's default constructor.

To be default constructible, Archive::child_iterator needs to be able to
construct an Archive::Child with a null parent, however Archive::Child's
constructor always dereferenced its Parent argument to compute the remaining
archive size. This commit fixes Archive::Child's constructor to only do the
size calculation when the parent is non-null.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283387 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Object/Archive.h
lib/Object/Archive.cpp