1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

[dsymutil] Fix assertion triggered by empty address range.

An assertion was hit when running dsymutil on a gcc generated binary
that contained an empty address range. Address ranges are stored in an
interval map of half open intervals. Since the interval is empty and
therefore meaningless, we simply don't add it to the map.

llvm-svn: 350591
This commit is contained in:
Jonas Devlieghere 2019-01-08 01:08:09 +00:00
parent 14f2d4b5ff
commit 87026ed639

View File

@ -92,7 +92,11 @@ void CompileUnit::addLabelLowPc(uint64_t LabelLowPc, int64_t PcOffset) {
void CompileUnit::addFunctionRange(uint64_t FuncLowPc, uint64_t FuncHighPc,
int64_t PcOffset) {
Ranges.insert(FuncLowPc, FuncHighPc, PcOffset);
// Don't add empty ranges to the interval map. They are a problem because
// the interval map expects half open intervals. This is safe because they
// are empty anyway.
if (FuncHighPc != FuncLowPc)
Ranges.insert(FuncLowPc, FuncHighPc, PcOffset);
this->LowPc = std::min(LowPc, FuncLowPc + PcOffset);
this->HighPc = std::max(HighPc, FuncHighPc + PcOffset);
}