Revert "[DWARF] Delete redundant check in DWARFAddressRange::intersects"
This reverts rL358377. It isn't redundant, though the semantic seems weird.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358381 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/llvm/DebugInfo/DWARF/DWARFAddressRange.h b/include/llvm/DebugInfo/DWARF/DWARFAddressRange.h
index 128b410..56d46c6 100644
--- a/include/llvm/DebugInfo/DWARF/DWARFAddressRange.h
+++ b/include/llvm/DebugInfo/DWARF/DWARFAddressRange.h
@@ -36,6 +36,9 @@
/// Returns true if [LowPC, HighPC) intersects with [RHS.LowPC, RHS.HighPC).
bool intersects(const DWARFAddressRange &RHS) const {
assert(valid() && RHS.valid());
+ // Empty ranges can't intersect.
+ if (LowPC == HighPC || RHS.LowPC == RHS.HighPC)
+ return false;
return LowPC < RHS.HighPC && RHS.LowPC < HighPC;
}