diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-07-03 22:55:57 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-07-03 22:55:57 +0000 |
commit | 017591ab45a849a237f2c4b3265896db194dcbe9 (patch) | |
tree | 0dc5ce60422eaeb7cd82b729e918d769e669ec93 /clang/lib/StaticAnalyzer/Core/Calls.cpp | |
parent | 8a369a82d5a0dfa5827fc56be952a257b61df8f8 (diff) | |
download | bcm5719-llvm-017591ab45a849a237f2c4b3265896db194dcbe9.tar.gz bcm5719-llvm-017591ab45a849a237f2c4b3265896db194dcbe9.zip |
[analyzer] For now, don't inline non-static member overloaded operators.
Our current inlining support (specifically RegionStore::enterStackFrame)
doesn't know that calls to overloaded operators may be calls to non-static
member functions, and that in these cases the first argument should be
treated as 'this'. This caused incorrect results and sometimes crashes.
The long-term fix will be to rewrite RegionStore::enterStackFrame to use
CallEvent and its subclasses, but for now we can just disable these
problematic calls by classifying them under a new CallEvent,
CXXMemberOperatorCall.
llvm-svn: 159692
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/Calls.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/Calls.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/Calls.cpp b/clang/lib/StaticAnalyzer/Core/Calls.cpp index 35ddfc965f1..24c5ab12ab1 100644 --- a/clang/lib/StaticAnalyzer/Core/Calls.cpp +++ b/clang/lib/StaticAnalyzer/Core/Calls.cpp @@ -303,6 +303,14 @@ void CXXMemberCall::addExtraInvalidatedRegions(RegionList &Regions) const { } +void +CXXMemberOperatorCall::addExtraInvalidatedRegions(RegionList &Regions) const { + const Expr *Base = getOriginExpr()->getArg(0); + if (const MemRegion *R = getSVal(Base).getAsRegion()) + Regions.push_back(R); +} + + const BlockDataRegion *BlockCall::getBlockRegion() const { const Expr *Callee = getOriginExpr()->getCallee(); const MemRegion *DataReg = getSVal(Callee).getAsRegion(); |