[llvm] r336837 - [DebugInfo] Fix getPreviousSibling after r336823
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 11 12:09:37 PDT 2018
Author: maskray
Date: Wed Jul 11 12:09:37 2018
New Revision: 336837
URL: http://llvm.org/viewvc/llvm-project?rev=336837&view=rev
Log:
[DebugInfo] Fix getPreviousSibling after r336823
Modified:
llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp
Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp?rev=336837&r1=336836&r2=336837&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp Wed Jul 11 12:09:37 2018
@@ -593,7 +593,8 @@ DWARFDie DWARFUnit::getPreviousSibling(c
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)
More information about the llvm-commits
mailing list