Fix a bug introduced by the move of AddressRanges.h into ADT.
authorGreg Clayton <gclayton@fb.com>
Tue, 14 Jun 2022 23:44:21 +0000 (16:44 -0700)
committerGreg Clayton <gclayton@fb.com>
Thu, 16 Jun 2022 17:50:46 +0000 (10:50 -0700)
commit838a57e1a5639a6fa9b8f8bdce5b6129a8c4302b
tree42f71f87d6dc6aa3edf6c27eabc957f94b57f353
parent2665fbe71e1d1897da3abad6c6cc3c32020e0bff
Fix a bug introduced by the move of AddressRanges.h into ADT.

The bug was introduced when the AddressRange class was no longer able to modify the End address directly and the entire range of the .text address range that contained the trailing empty symbol was replaced. There was no unit test for this, so it wasn't caught. I fixed the bug and added a unit test for it.

The effects of this bug are serious as the AddressOffsetSize in the header would be incorrectly calculated and an invalid GSYM would be created.

Differential Revision: https://reviews.llvm.org/D127811
llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp