]> granicus.if.org Git - clang/commitdiff
Fixup to r196593.
authorAnna Zaks <ganna@apple.com>
Fri, 6 Dec 2013 19:28:16 +0000 (19:28 +0000)
committerAnna Zaks <ganna@apple.com>
Fri, 6 Dec 2013 19:28:16 +0000 (19:28 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196599 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/malloc.c

index a0296cb0036dc5252e59efa954d62796fd32fddf..58d40a31a835ef74ac539fdd79b579a7144c580c 100644 (file)
@@ -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.