[PATCH] D47915: [asan] Handle 0 alignment in PosixMemalignFromLocalPool
Walter Lee via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 7 15:46:54 PDT 2018
waltl created this revision.
waltl added reviewers: vitalybuka, alekseyshl.
Herald added a subscriber: kubamracek.
The previous CHECK was wrong because alignment can be 0.
Repository:
rL LLVM
https://reviews.llvm.org/D47915
Files:
compiler-rt/lib/asan/asan_malloc_linux.cc
Index: compiler-rt/lib/asan/asan_malloc_linux.cc
===================================================================
--- compiler-rt/lib/asan/asan_malloc_linux.cc
+++ compiler-rt/lib/asan/asan_malloc_linux.cc
@@ -51,7 +51,7 @@
if (UNLIKELY(!CheckPosixMemalignAlignment(alignment)))
return errno_EINVAL;
- CHECK(alignment >= kWordSize);
+ alignment = Max(alignment, kWordSize);
uptr addr = (uptr)&alloc_memory_for_dlsym[allocated_for_dlsym];
uptr aligned_addr = RoundUpTo(addr, alignment);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47915.150424.patch
Type: text/x-patch
Size: 509 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180607/1137b6fe/attachment.bin>
More information about the llvm-commits
mailing list