summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-06-25 20:48:28 +0000
committerJordan Rose <jordan_rose@apple.com>2012-06-25 20:48:28 +0000
commit4688e608612d9582e150815f39a2b6a5d60596fd (patch)
treedba18bcf2b9bb52c91cdbbe519609cb7ea3d5d7a /clang/lib/StaticAnalyzer/Checkers
parent55ce352d4d0119913a9c51ba81fd2659e76cab84 (diff)
downloadbcm5719-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.cpp3
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.
OpenPOWER on IntegriCloud