|
@@ -36,8 +36,7 @@ bool CheckerManager::hasPathSensitiveCheckers() const {
|
|
!DeadSymbolsCheckers.empty() ||
|
|
!DeadSymbolsCheckers.empty() ||
|
|
!RegionChangesCheckers.empty() ||
|
|
!RegionChangesCheckers.empty() ||
|
|
!EvalAssumeCheckers.empty() ||
|
|
!EvalAssumeCheckers.empty() ||
|
|
- !EvalCallCheckers.empty() ||
|
|
|
|
- !InlineCallCheckers.empty();
|
|
|
|
|
|
+ !EvalCallCheckers.empty();
|
|
}
|
|
}
|
|
|
|
|
|
void CheckerManager::finishedCheckerRegistration() {
|
|
void CheckerManager::finishedCheckerRegistration() {
|
|
@@ -508,41 +507,13 @@ void CheckerManager::runCheckersForEvalCall(ExplodedNodeSet &Dst,
|
|
const CallExpr *CE = cast<CallExpr>(Call.getOriginExpr());
|
|
const CallExpr *CE = cast<CallExpr>(Call.getOriginExpr());
|
|
for (ExplodedNodeSet::iterator
|
|
for (ExplodedNodeSet::iterator
|
|
NI = Src.begin(), NE = Src.end(); NI != NE; ++NI) {
|
|
NI = Src.begin(), NE = Src.end(); NI != NE; ++NI) {
|
|
-
|
|
|
|
ExplodedNode *Pred = *NI;
|
|
ExplodedNode *Pred = *NI;
|
|
bool anyEvaluated = false;
|
|
bool anyEvaluated = false;
|
|
|
|
|
|
- // First, check if any of the InlineCall callbacks can evaluate the call.
|
|
|
|
- assert(InlineCallCheckers.size() <= 1 &&
|
|
|
|
- "InlineCall is a special hacky callback to allow intrusive"
|
|
|
|
- "evaluation of the call (which simulates inlining). It is "
|
|
|
|
- "currently only used by OSAtomicChecker and should go away "
|
|
|
|
- "at some point.");
|
|
|
|
- for (std::vector<InlineCallFunc>::iterator
|
|
|
|
- EI = InlineCallCheckers.begin(), EE = InlineCallCheckers.end();
|
|
|
|
- EI != EE; ++EI) {
|
|
|
|
- ExplodedNodeSet checkDst;
|
|
|
|
- bool evaluated = (*EI)(CE, Eng, Pred, checkDst);
|
|
|
|
- assert(!(evaluated && anyEvaluated)
|
|
|
|
- && "There are more than one checkers evaluating the call");
|
|
|
|
- if (evaluated) {
|
|
|
|
- anyEvaluated = true;
|
|
|
|
- Dst.insert(checkDst);
|
|
|
|
-#ifdef NDEBUG
|
|
|
|
- break; // on release don't check that no other checker also evals.
|
|
|
|
-#endif
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-#ifdef NDEBUG // on release don't check that no other checker also evals.
|
|
|
|
- if (anyEvaluated) {
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
ExplodedNodeSet checkDst;
|
|
ExplodedNodeSet checkDst;
|
|
NodeBuilder B(Pred, checkDst, Eng.getBuilderContext());
|
|
NodeBuilder B(Pred, checkDst, Eng.getBuilderContext());
|
|
- // Next, check if any of the EvalCall callbacks can evaluate the call.
|
|
|
|
|
|
+
|
|
|
|
+ // Check if any of the EvalCall callbacks can evaluate the call.
|
|
for (std::vector<EvalCallFunc>::iterator
|
|
for (std::vector<EvalCallFunc>::iterator
|
|
EI = EvalCallCheckers.begin(), EE = EvalCallCheckers.end();
|
|
EI = EvalCallCheckers.begin(), EE = EvalCallCheckers.end();
|
|
EI != EE; ++EI) {
|
|
EI != EE; ++EI) {
|
|
@@ -678,10 +649,6 @@ void CheckerManager::_registerForEvalCall(EvalCallFunc checkfn) {
|
|
EvalCallCheckers.push_back(checkfn);
|
|
EvalCallCheckers.push_back(checkfn);
|
|
}
|
|
}
|
|
|
|
|
|
-void CheckerManager::_registerForInlineCall(InlineCallFunc checkfn) {
|
|
|
|
- InlineCallCheckers.push_back(checkfn);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
void CheckerManager::_registerForEndOfTranslationUnit(
|
|
void CheckerManager::_registerForEndOfTranslationUnit(
|
|
CheckEndOfTranslationUnit checkfn) {
|
|
CheckEndOfTranslationUnit checkfn) {
|
|
EndOfTranslationUnitCheckers.push_back(checkfn);
|
|
EndOfTranslationUnitCheckers.push_back(checkfn);
|