[PATCH] D19572: Add another failing use-after-scope test

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Mon May 2 16:17:58 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL268330: Add another failing use-after-scope test (authored by vitalybuka).

Changed prior to commit:
  http://reviews.llvm.org/D19572?vs=55133&id=55909#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D19572

Files:
  compiler-rt/trunk/test/asan/TestCases/use-after-scope-chars.cc

Index: compiler-rt/trunk/test/asan/TestCases/use-after-scope-chars.cc
===================================================================
--- compiler-rt/trunk/test/asan/TestCases/use-after-scope-chars.cc
+++ compiler-rt/trunk/test/asan/TestCases/use-after-scope-chars.cc
@@ -0,0 +1,15 @@
+// RUN: %clangxx_asan -O1 -mllvm -asan-use-after-scope=1 %s -o %t && \
+// RUN:     not %run %t 2>&1 | FileCheck %s
+// XFAIL: *
+
+// FIXME: This works only for arraysize <= 8.
+
+char *p = 0;
+
+int main() {
+  {
+    char x[1024] = {};
+    p = x;
+  }
+  return *p;  // BOOM
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19572.55909.patch
Type: text/x-patch
Size: 572 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160502/c7b71ec7/attachment-0001.bin>


More information about the llvm-commits mailing list