diff options
author | Anna Zaks <ganna@apple.com> | 2012-12-11 00:17:53 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-12-11 00:17:53 +0000 |
commit | c2cca2361aeafdf9170de2695b17d8bcd1c6f7db (patch) | |
tree | 8c56f59a82dde9840413b10b9dff7543403350b9 /lib/StaticAnalyzer/Checkers/MallocChecker.cpp | |
parent | 39450d0469e0d5589ad39fd0b20b5742750619a0 (diff) |
[analyzer] Don't generate a summary for "freeWhenDone" if method is
inlined.
Fixes a false positive that occurs if a user writes their own
initWithBytesNoCopy:freeWhenDone wrapper.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169795 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/MallocChecker.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Checkers/MallocChecker.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/lib/StaticAnalyzer/Checkers/MallocChecker.cpp index 6d48f0258b..26fd1c26ea 100644 --- a/lib/StaticAnalyzer/Checkers/MallocChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/MallocChecker.cpp @@ -499,6 +499,9 @@ static bool isFreeWhenDoneSetToZero(const ObjCMethodCall &Call) { void MallocChecker::checkPostObjCMessage(const ObjCMethodCall &Call, CheckerContext &C) const { + if (C.wasInlined) + return; + // If the first selector is dataWithBytesNoCopy, assume that the memory will // be released with 'free' by the new object. // Ex: [NSData dataWithBytesNoCopy:bytes length:10]; |