[compiler-rt] r275644 - [asan] trying to fix the windows build

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 15 16:13:03 PDT 2016


Author: kcc
Date: Fri Jul 15 18:13:03 2016
New Revision: 275644

URL: http://llvm.org/viewvc/llvm-project?rev=275644&view=rev
Log:
[asan] trying to fix the windows build 

Added:
    compiler-rt/trunk/test/asan/TestCases/Linux/memmem_test.cc
      - copied unchanged from r275621, compiler-rt/trunk/test/asan/TestCases/memmem_test.cc
Removed:
    compiler-rt/trunk/test/asan/TestCases/memmem_test.cc
Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h?rev=275644&r1=275643&r2=275644&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h Fri Jul 15 18:13:03 2016
@@ -83,7 +83,8 @@
 #define SANITIZER_INTERCEPT_MEMMOVE 1
 #define SANITIZER_INTERCEPT_MEMCPY 1
 #define SANITIZER_INTERCEPT_MEMCMP 1
-#define SANITIZER_INTERCEPT_MEMMEM 1
+// FIXME: enable memmem on Windows.
+#define SANITIZER_INTERCEPT_MEMMEM SI_NOT_WINDOWS
 // The function memchr() contains a jump in the first 6 bytes
 // that is problematic to intercept correctly on Win64.
 // Disable memchr() interception for Win64.

Removed: compiler-rt/trunk/test/asan/TestCases/memmem_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/memmem_test.cc?rev=275643&view=auto
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/memmem_test.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/memmem_test.cc (removed)
@@ -1,21 +0,0 @@
-// RUN: %clangxx_asan  %s -o %t
-// RUN: not %run %t   2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=A1
-// RUN: not %run %t 1 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=A2
-// RUN: %env_asan_opts=intercept_memmem=0 %run %t
-
-#include <string.h>
-int main(int argc, char **argv) {
-  char a1[] = {1, 2, 3, 4, 5, 6, 7, 8};
-  char a2[] = {3, 4, 5};
-  void *res;
-  if (argc == 1)
-    res = memmem(a1, sizeof(a1) + 1, a2, sizeof(a2));  // BOOM
-  else
-    res = memmem(a1, sizeof(a1), a2, sizeof(a2) + 1);  // BOOM
-  // CHECK: AddressSanitizer: stack-buffer-overflow
-  // CHECK: {{#0.*memmem}}
-  // CHECK: {{#1.*main}}
-  // A1: 'a1' <== Memory access at offset
-  // A2: 'a2' <== Memory access at offset
-  return res == NULL;
-}




More information about the llvm-commits mailing list