r183600 - [analyzer] Minor fixups to r183062
Anna Zaks
ganna at apple.com
Fri Jun 7 17:29:29 PDT 2013
Author: zaks
Date: Fri Jun 7 19:29:29 2013
New Revision: 183600
URL: http://llvm.org/viewvc/llvm-project?rev=183600&view=rev
Log:
[analyzer] Minor fixups to r183062
Based on feedback from Jordan.
Modified:
cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp?rev=183600&r1=183599&r2=183600&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp Fri Jun 7 19:29:29 2013
@@ -282,14 +282,14 @@ private:
/// Check if the function is known free memory, or if it is
/// "interesting" and should be modeled explicitly.
///
- /// \param EscapingSymbol A function might not free memory in general, but
- /// could be known to free a particular symbol. In this case, false is
+ /// \param [out] EscapingSymbol A function might not free memory in general,
+ /// but could be known to free a particular symbol. In this case, false is
/// returned and the single escaping symbol is returned through the out
/// parameter.
///
/// We assume that pointers do not escape through calls to system functions
/// not handled by this checker.
- bool mayFreeAnyEscapedMemoryOrIsModelledExplicitely(const CallEvent *Call,
+ bool mayFreeAnyEscapedMemoryOrIsModeledExplicitly(const CallEvent *Call,
ProgramStateRef State,
SymbolRef &EscapingSymbol) const;
@@ -1848,12 +1848,13 @@ ProgramStateRef MallocChecker::evalAssum
return state;
}
-bool MallocChecker::mayFreeAnyEscapedMemoryOrIsModelledExplicitely(
+bool MallocChecker::mayFreeAnyEscapedMemoryOrIsModeledExplicitly(
const CallEvent *Call,
ProgramStateRef State,
SymbolRef &EscapingSymbol) const {
assert(Call);
-
+ EscapingSymbol = 0;
+
// For now, assume that any C++ 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
@@ -2030,8 +2031,8 @@ ProgramStateRef MallocChecker::checkPoin
// call later, keep tracking the top level arguments.
SymbolRef EscapingSymbol = 0;
if (Kind == PSK_DirectEscapeOnCall &&
- !mayFreeAnyEscapedMemoryOrIsModelledExplicitely(Call, State,
- EscapingSymbol) &&
+ !mayFreeAnyEscapedMemoryOrIsModeledExplicitly(Call, State,
+ EscapingSymbol) &&
!EscapingSymbol) {
return State;
}
More information about the cfe-commits
mailing list