aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/GRExprEngine.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-04-09 04:06:51 +0000
committerTed Kremenek <kremenek@apple.com>2009-04-09 04:06:51 +0000
commite644939bf85869a6b172402b3d934a1a95f1cc2f (patch)
tree719d51520740d4b740bdf41fe5676e305a944c59 /lib/Analysis/GRExprEngine.cpp
parent95bf5d6a86146cb99a1c8a32d4422a46be32fe65 (diff)
Fix another regression introduced by changes to the analyzer's reasoning about
nil receivers in message expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68672 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r--lib/Analysis/GRExprEngine.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index 365f8d64c4..caa0192ccd 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -1702,10 +1702,10 @@ void GRExprEngine::VisitObjCMessageExprDispatchHelper(ObjCMessageExpr* ME,
N->markAsSink();
if (isFeasibleNotNull)
NilReceiverStructRetImplicit.insert(N);
- else
- NilReceiverStructRetExplicit.insert(N);
-
- return;
+ else {
+ NilReceiverStructRetExplicit.insert(N);
+ return;
+ }
}
}
}
@@ -1721,21 +1721,22 @@ void GRExprEngine::VisitObjCMessageExprDispatchHelper(ObjCMessageExpr* ME,
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