diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-02-21 19:46:04 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-02-21 19:46:04 +0000 |
commit | 03da0d7eaa6da319f6a1816b886f3ad796ef50cc (patch) | |
tree | acf5540d286c87e0ff84a72cc648d10088481ee9 | |
parent | 86e07b6c2588ed18f34b19752cd48a9dbf3a0171 (diff) |
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
-rw-r--r-- | Analysis/GRExprEngine.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
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<LVal>(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<LVal>(V)) + St = SetRVal(St, cast<LVal>(V), UnknownVal()); + } + } + else + St = EvalCall(CE, cast<LVal>(L), (*DI)->getState()); + + Nodify(Dst, CE, *DI, St); } } |