[cfe-commits] r155945 - /cfe/trunk/test/Analysis/malloc.c

Anna Zaks ganna at apple.com
Tue May 1 14:10:29 PDT 2012


Author: zaks
Date: Tue May  1 16:10:29 2012
New Revision: 155945

URL: http://llvm.org/viewvc/llvm-project?rev=155945&view=rev
Log:
[analyzer] Test case reported for a reported false positive, now fixed.

Modified:
    cfe/trunk/test/Analysis/malloc.c

Modified: cfe/trunk/test/Analysis/malloc.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/malloc.c?rev=155945&r1=155944&r2=155945&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/malloc.c (original)
+++ cfe/trunk/test/Analysis/malloc.c Tue May  1 16:10:29 2012
@@ -783,6 +783,15 @@
   return ptr; // no warning
 }
 
+void __assert_rtn(const char *, const char *, int, const char *) __attribute__((__noreturn__));
+int strcmp(const char *, const char *);
+char *a (void);
+void radar11270219(void) {
+  char *x = a(), *y = a();
+  (__builtin_expect(!(x && y), 0) ? __assert_rtn(__func__, "/Users/zaks/tmp/ex.c", 24, "x && y") : (void)0);
+  strcmp(x, y); // no warning
+}
+
 // ----------------------------------------------------------------------------
 // Below are the known false positives.
 





More information about the cfe-commits mailing list