[PATCH] D39474: [asan] Avoid assert failure for non-default shadow scale
Walter Lee via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 16 14:03:56 PST 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL318460: [asan] Avoid assert failure for non-default shadow scale (authored by waltl).
Changed prior to commit:
https://reviews.llvm.org/D39474?vs=121053&id=123238#toc
Repository:
rL LLVM
https://reviews.llvm.org/D39474
Files:
compiler-rt/trunk/lib/asan/asan_fake_stack.cc
Index: compiler-rt/trunk/lib/asan/asan_fake_stack.cc
===================================================================
--- compiler-rt/trunk/lib/asan/asan_fake_stack.cc
+++ compiler-rt/trunk/lib/asan/asan_fake_stack.cc
@@ -28,9 +28,9 @@
// For small size classes inline PoisonShadow for better performance.
ALWAYS_INLINE void SetShadow(uptr ptr, uptr size, uptr class_id, u64 magic) {
- CHECK_EQ(SHADOW_SCALE, 3); // This code expects SHADOW_SCALE=3.
u64 *shadow = reinterpret_cast<u64*>(MemToShadow(ptr));
- if (class_id <= 6) {
+ if (SHADOW_SCALE == 3 && class_id <= 6) {
+ // This code expects SHADOW_SCALE=3.
for (uptr i = 0; i < (((uptr)1) << class_id); i++) {
shadow[i] = magic;
// Make sure this does not become memset.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39474.123238.patch
Type: text/x-patch
Size: 762 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171116/a3954343/attachment.bin>
More information about the llvm-commits
mailing list