diff options
author | Anna Zaks <ganna@apple.com> | 2012-02-14 21:55:24 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-02-14 21:55:24 +0000 |
commit | 3d34834bb061295c9858080e2b3055751396fbe3 (patch) | |
tree | 2afa554e95b78b4fe064507c49783b53d72e5478 /clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp | |
parent | 78f815d3a47a99a7fca1046f40ad3cf75ea04822 (diff) | |
download | bcm5719-llvm-3d34834bb061295c9858080e2b3055751396fbe3.tar.gz bcm5719-llvm-3d34834bb061295c9858080e2b3055751396fbe3.zip |
[analyzer] Make Malloc Checker optimistic in presence of inlining.
(In response of Ted's review of r150112.)
This moves the logic which checked if a symbol escapes through a
parameter to invalidateRegionCallback (instead of post CallExpr visit.)
To accommodate the change, added a CallOrObjCMessage parameter to
checkRegionChanges callback.
llvm-svn: 150513
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp index 748fc43a677..dcc62a60cb9 100644 --- a/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp @@ -64,7 +64,8 @@ public: checkRegionChanges(ProgramStateRef state, const StoreManager::InvalidatedSymbols *, ArrayRef<const MemRegion *> ExplicitRegions, - ArrayRef<const MemRegion *> Regions) const; + ArrayRef<const MemRegion *> Regions, + const CallOrObjCMessage *Call) const; typedef void (CStringChecker::*FnCheck)(CheckerContext &, const CallExpr *) const; @@ -1807,7 +1808,8 @@ ProgramStateRef CStringChecker::checkRegionChanges(ProgramStateRef state, const StoreManager::InvalidatedSymbols *, ArrayRef<const MemRegion *> ExplicitRegions, - ArrayRef<const MemRegion *> Regions) const { + ArrayRef<const MemRegion *> Regions, + const CallOrObjCMessage *Call) const { CStringLength::EntryMap Entries = state->get<CStringLength>(); if (Entries.isEmpty()) return state; |