/// Evaluate arguments with a work list algorithm.
void EvalArguments(ConstExprIterator AI, ConstExprIterator AE,
const FunctionProtoType *FnType,
- ExplodedNode *Pred, ExplodedNodeSet &Dst);
+ ExplodedNode *Pred, ExplodedNodeSet &Dst,
+ bool FstArgAsLValue = false);
/// EvalEagerlyAssume - Given the nodes in 'Src', eagerly assume symbolic
/// expressions of the form 'x != 0' and generate new nodes (stored in Dst)
void GRExprEngine::EvalArguments(ConstExprIterator AI, ConstExprIterator AE,
const FunctionProtoType *FnType,
- ExplodedNode *Pred, ExplodedNodeSet &Dst) {
+ ExplodedNode *Pred, ExplodedNodeSet &Dst,
+ bool FstArgAsLValue) {
llvm::SmallVector<CallExprWLItem, 20> WorkList;
// Evaluate the argument.
ExplodedNodeSet Tmp;
- const unsigned ParamIdx = Item.I - AI;
- const bool VisitAsLvalue = FnType && ParamIdx < FnType->getNumArgs()
- ? FnType->getArgType(ParamIdx)->isReferenceType()
- : false;
+ bool VisitAsLvalue = FstArgAsLValue;
+ if (FstArgAsLValue) {
+ FstArgAsLValue = false;
+ } else {
+ const unsigned ParamIdx = Item.I - AI;
+ VisitAsLvalue = FnType && ParamIdx < FnType->getNumArgs()
+ ? FnType->getArgType(ParamIdx)->isReferenceType()
+ : false;
+ }
if (VisitAsLvalue)
VisitLValue(*Item.I, Item.N, Tmp);