summaryrefslogtreecommitdiff
path: root/lib/hwasan/hwasan.cc
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2018-12-18 00:48:07 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2018-12-18 00:48:07 +0000
commit5e25fbb59a928b1de221a29e4e2893258936308d (patch)
tree15fd392eb25b6866ce7f2b2930d5aeeb93cad693 /lib/hwasan/hwasan.cc
parent4b81a4542b7b4baef0528036433ccf05956f0365 (diff)
downloadcompiler-rt-5e25fbb59a928b1de221a29e4e2893258936308d.tar.gz
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@349428 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/hwasan/hwasan.cc')
-rw-r--r--lib/hwasan/hwasan.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/hwasan/hwasan.cc b/lib/hwasan/hwasan.cc
index da95891d8..9f2328dfa 100644
--- a/lib/hwasan/hwasan.cc
+++ b/lib/hwasan/hwasan.cc
@@ -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++)