diff --git a/clang/lib/Checker/CallInliner.cpp b/clang/lib/Checker/CallInliner.cpp index 150102c5ef26..659d9b8bcfa4 100644 --- a/clang/lib/Checker/CallInliner.cpp +++ b/clang/lib/Checker/CallInliner.cpp @@ -26,7 +26,6 @@ public: } virtual bool EvalCallExpr(CheckerContext &C, const CallExpr *CE); - virtual void EvalEndPath(GREndPathNodeBuilder &B,void *tag,GRExprEngine &Eng); }; } @@ -53,17 +52,3 @@ bool CallInliner::EvalCallExpr(CheckerContext &C, const CallExpr *CE) { return true; } -void CallInliner::EvalEndPath(GREndPathNodeBuilder &B, void *tag, - GRExprEngine &Eng) { - const GRState *state = B.getState(); - - ExplodedNode *Pred = B.getPredecessor(); - - const StackFrameContext *LocCtx = - cast(Pred->getLocationContext()); - // Check if this is the top level stack frame. - if (!LocCtx->getParent()) - return; - - B.GenerateCallExitNode(state); -} diff --git a/clang/lib/Checker/GRCoreEngine.cpp b/clang/lib/Checker/GRCoreEngine.cpp index cbc1cf26216c..cc8abc870afb 100644 --- a/clang/lib/Checker/GRCoreEngine.cpp +++ b/clang/lib/Checker/GRCoreEngine.cpp @@ -612,7 +612,13 @@ GRSwitchNodeBuilder::generateDefaultCaseNode(const GRState* St, bool isSink) { GREndPathNodeBuilder::~GREndPathNodeBuilder() { // Auto-generate an EOP node if one has not been generated. - if (!HasGeneratedNode) generateNode(Pred->State); + if (!HasGeneratedNode) { + // If we are in an inlined call, generate CallExit node. + if (Pred->getLocationContext()->getParent()) + GenerateCallExitNode(Pred->State); + else + generateNode(Pred->State); + } } ExplodedNode*