[PATCH] D24490: [asan] Add another use cases can we previously get false reports

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 12 19:04:40 PDT 2016


vitalybuka created this revision.
vitalybuka added a reviewer: eugenis.
vitalybuka added a subscriber: llvm-commits.
Herald added a subscriber: kubabrecka.

PR28267

https://reviews.llvm.org/D24490

Files:
  test/asan/TestCases/use-after-scope-goto.c

Index: test/asan/TestCases/use-after-scope-goto.c
===================================================================
--- test/asan/TestCases/use-after-scope-goto.c
+++ test/asan/TestCases/use-after-scope-goto.c
@@ -5,7 +5,7 @@
 
 int *ptr;
 
-void f(int cond) {
+void f1(int cond) {
   if (cond)
     goto label;
   int tmp = 1;
@@ -15,7 +15,24 @@
   *ptr = 5;
 }
 
+void f2(int cond) {
+  switch (cond) {
+    case 1: {
+      ++cond;
+      int tmp = 1;
+      ptr = &tmp;
+      exit(0);
+    case 2:
+      ptr = &tmp;
+      *ptr = 5;
+      exit(0);
+    }
+  }
+}
+
 int main() {
-  f(1);
+  f1(1);
+  f2(2);
   return 0;
 }
+


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24490.71099.patch
Type: text/x-patch
Size: 635 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160913/31f1735e/attachment.bin>


More information about the llvm-commits mailing list