r196599 - Fixup to r196593.

Anna Zaks ganna at apple.com
Fri Dec 6 11:28:16 PST 2013


Author: zaks
Date: Fri Dec  6 13:28:16 2013
New Revision: 196599

URL: http://llvm.org/viewvc/llvm-project?rev=196599&view=rev
Log:
Fixup to r196593.

This is another regression fixed by reverting r189090.

In this case, the problem is not live variables but the approach that was taken in r189090. This regression was caused by explicitly binding "true" to the condition when we take the true branch. Normally that's okay, but in this case we're planning to reuse that condition as the value of the expression.

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=196599&r1=196598&r2=196599&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/malloc.c (original)
+++ cfe/trunk/test/Analysis/malloc.c Fri Dec  6 13:28:16 2013
@@ -1290,6 +1290,12 @@ char *dupstrWarn(const char *s) {
   return p;
 }
 
+int *radar15580979() {
+  int *data = (int *)malloc(32);
+  int *p = data ?: (int*)malloc(32); // no warning
+  return p;
+}
+
 // ----------------------------------------------------------------------------
 // False negatives.
 





More information about the cfe-commits mailing list