[PATCH] D53789: [hwasan] optionally right-align heap allocations

Kostya Serebryany via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 15 18:23:59 PST 2018


kcc added inline comments.


================
Comment at: lib/hwasan/hwasan_allocator.cc:92
+  switch (flags()->malloc_align_right) {
+    case 1:
+            right_align_mode = kRightAlignSometimes;
----------------
eugenis wrote:
> CHECK that the flag has a valid value
done


================
Comment at: lib/hwasan/hwasan_allocator.cc:272
   Metadata *b = (Metadata *)allocator.GetMetaData(untagged_ptr);
+  if (beg != untagged_ptr && !b->right_aligned) return 0;
   return b->requested_size;
----------------
eugenis wrote:
> if right_aligned, check that it is not more than one granule apart
done


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D53789





More information about the llvm-commits mailing list