|
@@ -16,6 +16,7 @@
|
|
#define DEBUG_TYPE "ExprEngine"
|
|
#define DEBUG_TYPE "ExprEngine"
|
|
|
|
|
|
#include "clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h"
|
|
#include "clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h"
|
|
|
|
+#include "PrettyStackTraceLocationContext.h"
|
|
#include "clang/AST/CharUnits.h"
|
|
#include "clang/AST/CharUnits.h"
|
|
#include "clang/AST/ParentMap.h"
|
|
#include "clang/AST/ParentMap.h"
|
|
#include "clang/AST/StmtCXX.h"
|
|
#include "clang/AST/StmtCXX.h"
|
|
@@ -263,6 +264,7 @@ void ExprEngine::processEndWorklist(bool hasWorkRemaining) {
|
|
|
|
|
|
void ExprEngine::processCFGElement(const CFGElement E, ExplodedNode *Pred,
|
|
void ExprEngine::processCFGElement(const CFGElement E, ExplodedNode *Pred,
|
|
unsigned StmtIdx, NodeBuilderContext *Ctx) {
|
|
unsigned StmtIdx, NodeBuilderContext *Ctx) {
|
|
|
|
+ PrettyStackTraceLocationContext CrashInfo(Pred->getLocationContext());
|
|
currStmtIdx = StmtIdx;
|
|
currStmtIdx = StmtIdx;
|
|
currBldrCtx = Ctx;
|
|
currBldrCtx = Ctx;
|
|
|
|
|
|
@@ -280,7 +282,6 @@ void ExprEngine::processCFGElement(const CFGElement E, ExplodedNode *Pred,
|
|
ProcessImplicitDtor(E.castAs<CFGImplicitDtor>(), Pred);
|
|
ProcessImplicitDtor(E.castAs<CFGImplicitDtor>(), Pred);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- currBldrCtx = 0;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
static bool shouldRemoveDeadBindings(AnalysisManager &AMgr,
|
|
static bool shouldRemoveDeadBindings(AnalysisManager &AMgr,
|
|
@@ -1202,7 +1203,8 @@ bool ExprEngine::replayWithoutInlining(ExplodedNode *N,
|
|
void ExprEngine::processCFGBlockEntrance(const BlockEdge &L,
|
|
void ExprEngine::processCFGBlockEntrance(const BlockEdge &L,
|
|
NodeBuilderWithSinks &nodeBuilder,
|
|
NodeBuilderWithSinks &nodeBuilder,
|
|
ExplodedNode *Pred) {
|
|
ExplodedNode *Pred) {
|
|
-
|
|
|
|
|
|
+ PrettyStackTraceLocationContext CrashInfo(Pred->getLocationContext());
|
|
|
|
+
|
|
// FIXME: Refactor this into a checker.
|
|
// FIXME: Refactor this into a checker.
|
|
if (nodeBuilder.getContext().blockCount() >= AMgr.options.maxBlockVisitOnPath) {
|
|
if (nodeBuilder.getContext().blockCount() >= AMgr.options.maxBlockVisitOnPath) {
|
|
static SimpleProgramPointTag tag("ExprEngine : Block count exceeded");
|
|
static SimpleProgramPointTag tag("ExprEngine : Block count exceeded");
|
|
@@ -1326,6 +1328,7 @@ void ExprEngine::processBranch(const Stmt *Condition, const Stmt *Term,
|
|
ExplodedNodeSet &Dst,
|
|
ExplodedNodeSet &Dst,
|
|
const CFGBlock *DstT,
|
|
const CFGBlock *DstT,
|
|
const CFGBlock *DstF) {
|
|
const CFGBlock *DstF) {
|
|
|
|
+ PrettyStackTraceLocationContext StackCrashInfo(Pred->getLocationContext());
|
|
currBldrCtx = &BldCtx;
|
|
currBldrCtx = &BldCtx;
|
|
|
|
|
|
// Check for NULL conditions; e.g. "for(;;)"
|
|
// Check for NULL conditions; e.g. "for(;;)"
|
|
@@ -1426,6 +1429,7 @@ void ExprEngine::processStaticInitializer(const DeclStmt *DS,
|
|
clang::ento::ExplodedNodeSet &Dst,
|
|
clang::ento::ExplodedNodeSet &Dst,
|
|
const CFGBlock *DstT,
|
|
const CFGBlock *DstT,
|
|
const CFGBlock *DstF) {
|
|
const CFGBlock *DstF) {
|
|
|
|
+ PrettyStackTraceLocationContext CrashInfo(Pred->getLocationContext());
|
|
currBldrCtx = &BuilderCtx;
|
|
currBldrCtx = &BuilderCtx;
|
|
|
|
|
|
const VarDecl *VD = cast<VarDecl>(DS->getSingleDecl());
|
|
const VarDecl *VD = cast<VarDecl>(DS->getSingleDecl());
|
|
@@ -1491,6 +1495,7 @@ void ExprEngine::processIndirectGoto(IndirectGotoNodeBuilder &builder) {
|
|
/// nodes when the control reaches the end of a function.
|
|
/// nodes when the control reaches the end of a function.
|
|
void ExprEngine::processEndOfFunction(NodeBuilderContext& BC,
|
|
void ExprEngine::processEndOfFunction(NodeBuilderContext& BC,
|
|
ExplodedNode *Pred) {
|
|
ExplodedNode *Pred) {
|
|
|
|
+ PrettyStackTraceLocationContext CrashInfo(Pred->getLocationContext());
|
|
StateMgr.EndPath(Pred->getState());
|
|
StateMgr.EndPath(Pred->getState());
|
|
|
|
|
|
ExplodedNodeSet Dst;
|
|
ExplodedNodeSet Dst;
|