[compiler-rt] r349428 - hwasan: Allow range of frame descriptors to be empty.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 17 16:48:08 PST 2018


Author: pcc
Date: Mon Dec 17 16:48:07 2018
New Revision: 349428

URL: http://llvm.org/viewvc/llvm-project?rev=349428&view=rev
Log:
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

Modified:
    compiler-rt/trunk/lib/hwasan/hwasan.cc

Modified: compiler-rt/trunk/lib/hwasan/hwasan.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/hwasan/hwasan.cc?rev=349428&r1=349427&r2=349428&view=diff
==============================================================================
--- compiler-rt/trunk/lib/hwasan/hwasan.cc (original)
+++ compiler-rt/trunk/lib/hwasan/hwasan.cc Mon Dec 17 16:48:07 2018
@@ -229,8 +229,8 @@ static InternalMmapVectorNoCtor<FrameDes
 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++)




More information about the llvm-commits mailing list