[llvm] r358381 - Revert "[DWARF] Delete redundant check in DWARFAddressRange::intersects"
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 15 02:01:10 PDT 2019
Author: maskray
Date: Mon Apr 15 02:01:10 2019
New Revision: 358381
URL: http://llvm.org/viewvc/llvm-project?rev=358381&view=rev
Log:
Revert "[DWARF] Delete redundant check in DWARFAddressRange::intersects"
This reverts rL358377. It isn't redundant, though the semantic seems weird.
Modified:
llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFAddressRange.h
Modified: llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFAddressRange.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFAddressRange.h?rev=358381&r1=358380&r2=358381&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFAddressRange.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFAddressRange.h Mon Apr 15 02:01:10 2019
@@ -36,6 +36,9 @@ struct DWARFAddressRange {
/// 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;
}
More information about the llvm-commits
mailing list