diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-06-25 20:48:28 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-06-25 20:48:28 +0000 |
commit | 4688e608612d9582e150815f39a2b6a5d60596fd (patch) | |
tree | dba18bcf2b9bb52c91cdbbe519609cb7ea3d5d7a /clang/lib/StaticAnalyzer/Checkers | |
parent | 55ce352d4d0119913a9c51ba81fd2659e76cab84 (diff) | |
download | bcm5719-llvm-4688e608612d9582e150815f39a2b6a5d60596fd.tar.gz bcm5719-llvm-4688e608612d9582e150815f39a2b6a5d60596fd.zip |
[analyzer] Be careful about implicitly-declared operator new/delete. (PR13090)
The implicit global allocation functions do not have valid source locations,
but we still want to treat them as being "system header" functions for the
purposes of how they affect program state.
llvm-svn: 159160
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp index 50d4273e48c..1aa9b824e30 100644 --- a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp @@ -1338,8 +1338,7 @@ bool MallocChecker::doesNotFreeMemory(const CallOrObjCMessage *Call, } // If it's not a system call, assume it frees memory. - SourceManager &SM = ASTC.getSourceManager(); - if (!SM.isInSystemHeader(D->getLocation())) + if (!Call->isInSystemHeader()) return false; // Process C/ObjC functions. |