diff options
| author | Fangrui Song <maskray@google.com> | 2018-07-11 19:09:37 +0000 |
|---|---|---|
| committer | Fangrui Song <maskray@google.com> | 2018-07-11 19:09:37 +0000 |
| commit | 24452316c6c5c8e1e84c7dab75c340e4d889438d (patch) | |
| tree | d5cdef8378d4b922b33cf05b67aa95cc155276fe /llvm/lib/DebugInfo | |
| parent | 7481f75d769870c7b6f00f72a824e10d97a2c0df (diff) | |
| download | bcm5719-llvm-24452316c6c5c8e1e84c7dab75c340e4d889438d.tar.gz bcm5719-llvm-24452316c6c5c8e1e84c7dab75c340e4d889438d.zip | |
[DebugInfo] Fix getPreviousSibling after r336823
llvm-svn: 336837
Diffstat (limited to 'llvm/lib/DebugInfo')
| -rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp index 7581575e2a4..2e965e0b94d 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp @@ -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) |

