[compiler-rt] r178874 - [asan] add a test for huge left oob

Kostya Serebryany kcc at google.com
Fri Apr 5 08:13:23 PDT 2013


Author: kcc
Date: Fri Apr  5 10:13:23 2013
New Revision: 178874

URL: http://llvm.org/viewvc/llvm-project?rev=178874&view=rev
Log:
[asan] add a test for huge left oob

Added:
    compiler-rt/trunk/lib/asan/lit_tests/huge_negative_hea_oob.cc

Added: compiler-rt/trunk/lib/asan/lit_tests/huge_negative_hea_oob.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/huge_negative_hea_oob.cc?rev=178874&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/lit_tests/huge_negative_hea_oob.cc (added)
+++ compiler-rt/trunk/lib/asan/lit_tests/huge_negative_hea_oob.cc Fri Apr  5 10:13:23 2013
@@ -0,0 +1,10 @@
+// RUN: %clangxx_asan -m64  %s -o %t && %t 2>&1 | %symbolize > %t.out
+// Check that we can find huge buffer overflows to the left.
+#include <stdlib.h>
+#include <string.h>
+int main(int argc, char **argv) {
+  char *x = (char*)malloc(1 << 20);
+  memset(x, 0, 10);
+  int res = x[-argc * 4000];  // BOOOM
+  // CHECK: is located 4000 bytes to the left of
+}





More information about the llvm-commits mailing list