Module BufferOverrunUtils.ReplaceCallee
type replaced={pname : IR.Procname.t;params : (IR.Exp.t * IR.Typ.t) list;is_params_ref : bool;}Replaced proc name with its modified parameters.
is_params_refrepresents that the parameters are given as references to variables, e.g., whenint i = 5;, the function ofstd::make_shared<C>(i);in C++ is translated tostd::make_shared<C>(&i, tgt)in Sil wheretgtis the variable for the target object, rather thanstd::make_shared<C>(i, tgt)(note that the type of&iisint&).The
is_params_refvalue is used to evaluate parameters correctly after replacing the callee. For example, when we replacestd::make_shared<C>(&i, tgt)to the constructor call ofC, i.e.C(tgt, i), the parameters' order and types are slightly different, so which should be handled correctly later in the instantiation phase.