[cfe-commits] r68672 - /cfe/trunk/lib/Analysis/GRExprEngine.cpp
Ted Kremenek
kremenek at apple.com
Wed Apr 8 21:06:52 PDT 2009
Author: kremenek
Date: Wed Apr 8 23:06:51 2009
New Revision: 68672
URL: http://llvm.org/viewvc/llvm-project?rev=68672&view=rev
Log:
Fix another regression introduced by changes to the analyzer's reasoning about
nil receivers in message expressions.
Modified:
cfe/trunk/lib/Analysis/GRExprEngine.cpp
Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=68672&r1=68671&r2=68672&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Wed Apr 8 23:06:51 2009
@@ -1702,10 +1702,10 @@
N->markAsSink();
if (isFeasibleNotNull)
NilReceiverStructRetImplicit.insert(N);
- else
- NilReceiverStructRetExplicit.insert(N);
-
- return;
+ else {
+ NilReceiverStructRetExplicit.insert(N);
+ return;
+ }
}
}
}
@@ -1721,21 +1721,22 @@
N->markAsSink();
if(isFeasibleNotNull)
NilReceiverLargerThanVoidPtrRetImplicit.insert(N);
- else
- NilReceiverLargerThanVoidPtrRetExplicit.insert(N);
-
- return;
+ else {
+ NilReceiverLargerThanVoidPtrRetExplicit.insert(N);
+ return;
+ }
}
}
else if (!isFeasibleNotNull) {
// FIXME: For now take the conservative approach that we only
// return null values if we *know* that the receiver is nil.
- // This is because we can have suprises like:
+ // This is because we can have surprises like:
//
- // if ([[NSScreens screens]count]) {
+ // if ([[NSScreens screens] count]) {
// ... = [[NSScreens screens] objectAtIndex:0];
//
- // In this case 'objectAtIndex:0' is guaranteed to not be zero.
+ // What can happen is that [... screens] should return the same
+ // value, but we won't necessarily catch that (yet).
//
// Handle the safe cases where the return value is 0 if the receiver
More information about the cfe-commits
mailing list