[llvm-dwarfdump] - Fix array out of bounds access crash.
authorGeorge Rimar <grimar@accesssoftek.com>
Wed, 25 Oct 2017 10:23:49 +0000 (10:23 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Wed, 25 Oct 2017 10:23:49 +0000 (10:23 +0000)
commit0be860f695e30b227e3358c182dd367026e6c91c
tree562e2d39a209b384736552cae50126170a9cb424
parent90bbcfd3508e6e5596ec15e46c0f3946bd509424
[llvm-dwarfdump] - Fix array out of bounds access crash.

This fixes possible out of bound access in
DWARFDie::getFirstChild()
which might happen when .debug_info section is corrupted,
like shown in testcase.

Differential revision: https://reviews.llvm.org/D39185

llvm-svn: 316566
llvm/include/llvm/DebugInfo/DWARF/DWARFDie.h
llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h
llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
llvm/test/tools/llvm-dwarfdump/X86/verify_debug_info2.s [new file with mode: 0644]