summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2013-02-07 23:05:43 +0000
committerAnna Zaks <ganna@apple.com>2013-02-07 23:05:43 +0000
commitacdc13cb00591e2ab2b168c7924d7eb57fa4808e (patch)
tree2bb86597344e1dc645c2501fc028214b3f8bdd17 /clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
parent7c1f408636d2d2cb2bc5890735d6cac1658dd28e (diff)
downloadbcm5719-llvm-acdc13cb00591e2ab2b168c7924d7eb57fa4808e.tar.gz
bcm5719-llvm-acdc13cb00591e2ab2b168c7924d7eb57fa4808e.zip
[analyzer] Add pointer escape type param to checkPointerEscape callback
The checkPointerEscape callback previously did not specify how a pointer escaped. This change includes an enum which describes the different ways a pointer may escape. This enum is passed to the checkPointerEscape callback when a pointer escapes. If the escape is due to a function call, the call is passed. This changes previous behavior where the call is passed as NULL if the escape was due to indirectly invalidating the region the pointer referenced. A patch by Branden Archer! llvm-svn: 174677
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExprEngine.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/ExprEngine.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
index 636aa3bd0d9..f092f1a3d8d 100644
--- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
@@ -1648,7 +1648,8 @@ ProgramStateRef ExprEngine::processPointerEscapedOnBind(ProgramStateRef State,
const InvalidatedSymbols &EscapedSymbols = Scanner.getSymbols();
State = getCheckerManager().runCheckersForPointerEscape(State,
EscapedSymbols,
- /*CallEvent*/ 0);
+ /*CallEvent*/ 0,
+ PSK_EscapeOnBind);
return State;
}
@@ -1665,7 +1666,9 @@ ExprEngine::processPointerEscapedOnInvalidateRegions(ProgramStateRef State,
if (!Call)
return getCheckerManager().runCheckersForPointerEscape(State,
- *Invalidated, 0);
+ *Invalidated,
+ 0,
+ PSK_EscapeOther);
// If the symbols were invalidated by a call, we want to find out which ones
// were invalidated directly due to being arguments to the call.
@@ -1687,12 +1690,12 @@ ExprEngine::processPointerEscapedOnInvalidateRegions(ProgramStateRef State,
if (!SymbolsDirectlyInvalidated.empty())
State = getCheckerManager().runCheckersForPointerEscape(State,
- SymbolsDirectlyInvalidated, Call);
+ SymbolsDirectlyInvalidated, Call, PSK_DirectEscapeOnCall);
// Notify about the symbols that get indirectly invalidated by the call.
if (!SymbolsIndirectlyInvalidated.empty())
State = getCheckerManager().runCheckersForPointerEscape(State,
- SymbolsIndirectlyInvalidated, /*CallEvent*/ 0);
+ SymbolsIndirectlyInvalidated, Call, PSK_IndirectEscapeOnCall);
return State;
}
OpenPOWER on IntegriCloud