diff options
author | Jordan Rose <jordan_rose@apple.com> | 2014-01-15 17:25:15 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2014-01-15 17:25:15 +0000 |
commit | 2a833ca575946d96987df063470fe9f3b3a865d3 (patch) | |
tree | 14d534a33638f5ecba02245b1de0fe4ddcb50afa /clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp | |
parent | e02e96a69fd64c4dd05467453bd4c018f150c2a2 (diff) | |
download | bcm5719-llvm-2a833ca575946d96987df063470fe9f3b3a865d3.tar.gz bcm5719-llvm-2a833ca575946d96987df063470fe9f3b3a865d3.zip |
[analyzer] BlockCall shouldn't really be an AnyFunctionCall.
Per discussion with Anna a /long/ time ago, it was way too easy to misuse
BlockCall: because it inherited from AnyFunctionCall (through SimpleCall),
getDecl() was constrained to return a FunctionDecl, and you had to call
getBlockDecl() instead. This goes against the whole point of CallEvent
(to abstract over different ways to invoke bodies of code).
Now, BlockCall just inherits directly from CallEvent. There's a bit of
duplication in getting things out of the origin expression (which is still
known to be a CallExpr), but nothing significant.
llvm-svn: 199321
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp index 92297ca3886..1e996589c1b 100644 --- a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp @@ -1907,11 +1907,11 @@ bool MallocChecker::mayFreeAnyEscapedMemoryOrIsModeledExplicitly( assert(Call); EscapingSymbol = 0; - // For now, assume that any C++ call can free memory. + // For now, assume that any C++ or block call can free memory. // TODO: If we want to be more optimistic here, we'll need to make sure that // regions escape to C++ containers. They seem to do that even now, but for // mysterious reasons. - if (!(isa<FunctionCall>(Call) || isa<ObjCMethodCall>(Call))) + if (!(isa<SimpleFunctionCall>(Call) || isa<ObjCMethodCall>(Call))) return true; // Check Objective-C messages by selector name. @@ -1966,7 +1966,7 @@ bool MallocChecker::mayFreeAnyEscapedMemoryOrIsModeledExplicitly( } // At this point the only thing left to handle is straight function calls. - const FunctionDecl *FD = cast<FunctionCall>(Call)->getDecl(); + const FunctionDecl *FD = cast<SimpleFunctionCall>(Call)->getDecl(); if (!FD) return true; |