From: Ted Kremenek Date: Thu, 21 Feb 2008 19:46:04 +0000 (+0000) Subject: Added transfer function support for dispatching to functions we don't know X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=03da0d7eaa6da319f6a1816b886f3ad796ef50cc;p=clang Added transfer function support for dispatching to functions we don't know about. The default logic is to invalidate the values of all values passed-by-reference. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47456 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Analysis/GRExprEngine.cpp b/Analysis/GRExprEngine.cpp index 66f5cae654..80de395c58 100644 --- a/Analysis/GRExprEngine.cpp +++ b/Analysis/GRExprEngine.cpp @@ -448,10 +448,20 @@ void GRExprEngine::VisitCall(CallExpr* CE, NodeTy* Pred, continue; } - // FIXME: EvalCall must handle the case where the callee is Unknown. - assert (!L.isUnknown()); - - Nodify(Dst, CE, *DI, EvalCall(CE, cast(L), (*DI)->getState())); + if (L.isUnknown()) { + // Invalidate all arguments passed in by reference (LVals). + for (CallExpr::arg_iterator I = CE->arg_begin(), E = CE->arg_end(); + I != E; ++I) { + RVal V = GetRVal(St, *I); + + if (isa(V)) + St = SetRVal(St, cast(V), UnknownVal()); + } + } + else + St = EvalCall(CE, cast(L), (*DI)->getState()); + + Nodify(Dst, CE, *DI, St); } }