aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Analysis/GRExprEngine.cpp18
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);
}
}