1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

[DebugInfo] Fix getPreviousSibling after r336823

llvm-svn: 336837
This commit is contained in:
Fangrui Song 2018-07-11 19:09:37 +00:00
parent b0ff9a0dd3
commit 72b30ea4e0

View File

@ -593,7 +593,8 @@ DWARFDie DWARFUnit::getPreviousSibling(const DWARFDebugInfoEntry *Die) {
return DWARFDie();
// Find the previous DIE whose depth is the same as the Die's depth.
for (size_t I = getDIEIndex(Die) - 1; I >= 0; --I) {
for (size_t I = getDIEIndex(Die); I > 0;) {
--I;
if (DieArray[I].getDepth() == Depth - 1)
return DWARFDie();
if (DieArray[I].getDepth() == Depth)