diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-02-28 00:56:05 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-02-28 00:56:05 +0000 |
commit | 4c62b557e269a27515dfca1f754ae936c8fdb824 (patch) | |
tree | 55227ce5bd531fbc28d09fdc1451962672b2108d /lib/StaticAnalyzer/Core/Environment.cpp | |
parent | 033d3007b16d7f6c0f0eafd06c7096cfd22d89f5 (diff) |
[analyzer] teach analyzer about ObjC literals, thus trimming out a false positive with the malloc() checker involving
comparing literal addresses to nil.
Fixes <rdar://problem/10579586>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151602 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/Environment.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/Environment.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/StaticAnalyzer/Core/Environment.cpp b/lib/StaticAnalyzer/Core/Environment.cpp index a44476e850..5207a506ae 100644 --- a/lib/StaticAnalyzer/Core/Environment.cpp +++ b/lib/StaticAnalyzer/Core/Environment.cpp @@ -90,6 +90,11 @@ SVal Environment::getSVal(const EnvironmentEntry &Entry, continue; case Stmt::ObjCPropertyRefExprClass: return loc::ObjCPropRef(cast<ObjCPropertyRefExpr>(E)); + case Stmt::ObjCStringLiteralClass: { + MemRegionManager &MRMgr = svalBuilder.getRegionManager(); + const ObjCStringLiteral *SL = cast<ObjCStringLiteral>(E); + return svalBuilder.makeLoc(MRMgr.getObjCStringRegion(SL)); + } case Stmt::StringLiteralClass: { MemRegionManager &MRMgr = svalBuilder.getRegionManager(); const StringLiteral *SL = cast<StringLiteral>(E); |