From a1354a5448cbc96decb7b3562edca0eaec875bcd Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 3 Mar 2008 16:47:31 +0000 Subject: [PATCH] Added FIXME. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47842 91177308-0d34-0410-b5e6-96231b3b80d8 --- Analysis/GRExprEngine.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Analysis/GRExprEngine.cpp b/Analysis/GRExprEngine.cpp index 29330da7eb..415c616bf9 100644 --- a/Analysis/GRExprEngine.cpp +++ b/Analysis/GRExprEngine.cpp @@ -508,11 +508,14 @@ void GRExprEngine::VisitCall(CallExpr* CE, NodeTy* Pred, // If we reach here we have processed all of the arguments. Evaluate // the callee expression. + NodeSet DstTmp; Expr* Callee = CE->getCallee()->IgnoreParenCasts(); - + VisitLVal(Callee, Pred, DstTmp); - if (DstTmp.empty()) DstTmp.Add(Pred); + + if (DstTmp.empty()) + DstTmp.Add(Pred); // Finally, evaluate the function call. for (NodeSet::iterator DI = DstTmp.begin(), DE = DstTmp.end(); DI!=DE; ++DI) { @@ -520,8 +523,11 @@ void GRExprEngine::VisitCall(CallExpr* CE, NodeTy* Pred, ValueState* St = (*DI)->getState(); RVal L = GetLVal(St, Callee); - // Check for undefined control-flow. - + // FIXME: Add support for symbolic function calls (calls involving + // function pointer values that are symbolic). + + // Check for undefined control-flow or calls to NULL. + if (L.isUndef() || isa(L)) { NodeTy* N = Builder->generateNode(CE, St, *DI); if (N) { @@ -529,7 +535,9 @@ void GRExprEngine::VisitCall(CallExpr* CE, NodeTy* Pred, BadCalls.insert(N); } continue; - } + } + + // Check for an "unknown" callee. if (L.isUnknown()) { // Invalidate all arguments passed in by reference (LVals). @@ -539,7 +547,7 @@ void GRExprEngine::VisitCall(CallExpr* CE, NodeTy* Pred, if (isa(V)) St = SetRVal(St, cast(V), UnknownVal()); - } + } } else St = EvalCall(CE, cast(L), (*DI)->getState()); -- 2.40.0