diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-09-08 01:47:28 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-09-08 01:47:28 +0000 |
commit | 5481cfefa63624c4a91da0e05a1140e29ce6f65a (patch) | |
tree | 5d26e608c771d274a213e33a9b8b95befd56140e /clang/lib/StaticAnalyzer/Core | |
parent | bd94e5d8156669d62f8724b2c7df8cf9ddd845c1 (diff) | |
download | bcm5719-llvm-5481cfefa63624c4a91da0e05a1140e29ce6f65a.tar.gz bcm5719-llvm-5481cfefa63624c4a91da0e05a1140e29ce6f65a.zip |
[analyzer] ObjCSelfInitChecker should always clean up in postCall checks.
ObjCSelfInitChecker stashes information in the GDM to persist it across
function calls; it is stored in pre-call checks and retrieved post-call.
The post-call check is supposed to clear out the stored state, but was
failing to do so in cases where the call did not have a symbolic return
value.
This was actually causing the inappropriate cache-out from r163361.
Per discussion with Anna, we should never actually cache out when
assuming the receiver of an Objective-C message is non-nil, because
we guarded that node generation by checking that the state has changed.
Therefore, the only states that could reach this exact ExplodedNode are
ones that should have merged /before/ making this assumption.
r163361 has been reverted and the test case removed, since it won't
actually test anything interesting now.
llvm-svn: 163449
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp index abe18bf835d..4f1a76e89ed 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp @@ -192,8 +192,10 @@ void ExprEngine::VisitObjCMessage(const ObjCMessageExpr *ME, } // Generate a transition to non-Nil state. - if (notNilState != State) + if (notNilState != State) { Pred = Bldr.generateNode(currStmt, Pred, notNilState); + assert(Pred && "Should have cached out already!"); + } } } else { // Check for special class methods. @@ -245,9 +247,7 @@ void ExprEngine::VisitObjCMessage(const ObjCMessageExpr *ME, } } - // Evaluate the call if we haven't cached out. - if (Pred) - defaultEvalCall(Bldr, Pred, *UpdatedMsg); + defaultEvalCall(Bldr, Pred, *UpdatedMsg); } ExplodedNodeSet dstPostvisit; |