diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2018-12-18 00:48:07 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2018-12-18 00:48:07 +0000 |
commit | 5e25fbb59a928b1de221a29e4e2893258936308d (patch) | |
tree | 15fd392eb25b6866ce7f2b2930d5aeeb93cad693 /lib/hwasan/hwasan.cc | |
parent | 4b81a4542b7b4baef0528036433ccf05956f0365 (diff) | |
download | compiler-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.cc | 4 |
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++) |