diff options
author | Alex Shlyapnikov <alekseys@google.com> | 2017-07-14 21:17:16 +0000 |
---|---|---|
committer | Alex Shlyapnikov <alekseys@google.com> | 2017-07-14 21:17:16 +0000 |
commit | e474b1c4087b0b9f9f2edaa514a256c42f345db6 (patch) | |
tree | 98623766693e2c815dd59c6fe88f5afad3f5d1dd /test/scudo | |
parent | 12d16901ebba5bc7185298e9efa3c4d265fa52ce (diff) |
[Sanitizers] Scudo allocator set errno on failure.
Summary:
Set proper errno code on alloction failure and change pvalloc and
posix_memalign implementation to satisfy their man-specified
requirements.
Reviewers: cryptoad
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D35429
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308053 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/scudo')
-rw-r--r-- | test/scudo/memalign.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/scudo/memalign.cpp b/test/scudo/memalign.cpp index 856128f24..82c54af8b 100644 --- a/test/scudo/memalign.cpp +++ b/test/scudo/memalign.cpp @@ -65,15 +65,15 @@ int main(int argc, char **argv) // Size is not a multiple of alignment. p = aligned_alloc(alignment, size >> 1); assert(!p); - p = (void *)0x42UL; + void *p_unchanged = (void *)0x42UL; + p = p_unchanged; // Alignment is not a power of 2. err = posix_memalign(&p, 3, size); - assert(!p); + assert(p == p_unchanged); assert(err == EINVAL); - p = (void *)0x42UL; // Alignment is a power of 2, but not a multiple of size(void *). err = posix_memalign(&p, 2, size); - assert(!p); + assert(p == p_unchanged); assert(err == EINVAL); } return 0; |