[PATCH] D36120: [msan] Reverting D36093

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 15:44:05 PDT 2017


cryptoad created this revision.

Reverting https://reviews.llvm.org/D36093 until I can figure out how to launch the correct tests :/
My apologies.


https://reviews.llvm.org/D36120

Files:
  lib/msan/msan_allocator.cc
  lib/msan/tests/msan_test.cc


Index: lib/msan/tests/msan_test.cc
===================================================================
--- lib/msan/tests/msan_test.cc
+++ lib/msan/tests/msan_test.cc
@@ -3449,17 +3449,6 @@
   EXPECT_EQ(0U, (uintptr_t)p % PageSize);
   EXPECT_EQ(PageSize, __sanitizer_get_allocated_size(p));
   free(p);
-
-  // Overflows in pvalloc should be caught.
-  errno = 0;
-  p = pvalloc((uintptr_t)-PageSize);
-  EXPECT_EQ(p, nullptr);
-  EXPECT_EQ(errno, ENOMEM);
-
-  errno = 0;
-  p = pvalloc((uintptr_t)-1);
-  EXPECT_EQ(p, nullptr);
-  EXPECT_EQ(errno, ENOMEM);
 }
 #endif
 
Index: lib/msan/msan_allocator.cc
===================================================================
--- lib/msan/msan_allocator.cc
+++ lib/msan/msan_allocator.cc
@@ -255,10 +255,6 @@
 
 void *msan_pvalloc(uptr size, StackTrace *stack) {
   uptr PageSize = GetPageSizeCached();
-  if (UNLIKELY(CheckForPvallocOverflow(size, PageSize))) {
-    errno = errno_ENOMEM;
-    return Allocator::FailureHandler::OnBadRequest();
-  }
   // pvalloc(0) should allocate one page.
   size = size ? RoundUpTo(size, PageSize) : PageSize;
   return SetErrnoOnNull(MsanAllocate(stack, size, PageSize, false));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36120.109018.patch
Type: text/x-patch
Size: 1167 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170731/481ad8cd/attachment.bin>


More information about the llvm-commits mailing list