hwasan: Allow range of frame descriptors to be empty.

As of r349413 it's now possible for a binary to contain an empty
hwasan frame section. Handle that case simply by doing nothing.

Differential Revision: https://reviews.llvm.org/D55796

llvm-svn: 349428
This commit is contained in:
Peter Collingbourne 2018-12-18 00:48:07 +00:00
parent 06caa6d2e6
commit 44ea4f5744
1 changed files with 2 additions and 2 deletions

View File

@ -229,8 +229,8 @@ static InternalMmapVectorNoCtor<FrameDescriptionArray> AllFrames;
void InitFrameDescriptors(uptr b, uptr e) {
FrameDescription *beg = reinterpret_cast<FrameDescription *>(b);
FrameDescription *end = reinterpret_cast<FrameDescription *>(e);
// Must have at least one entry, which we can use for a linked list.
CHECK_GE(end - beg, 1U);
if (beg == end)
return;
AllFrames.push_back({beg, end});
if (Verbosity())
for (FrameDescription *frame_descr = beg; frame_descr < end; frame_descr++)