Module BufferOverrunUtils.ReplaceCallee

type replaced = {
  1. pname : IR.Procname.t;
  2. args : (IR.Exp.t * IR.Typ.t) list;
  3. is_args_ref : bool;
}

Replaced proc name with its modified parameters.

is_args_ref represents that the arguments are given as references to variables, e.g., when int i = 5;, the function of std::make_shared<C>(i); in C++ is translated to std::make_shared<C>(&i, tgt) in Sil where tgt is the variable for the target object, rather than std::make_shared<C>(i, tgt) (note that the type of &i is int&).

The is_args_ref value is used to evaluate argments correctly after replacing the callee. For example, when we replace std::make_shared<C>(&i, tgt) to the constructor call of C, i.e. C(tgt, i), the arguments' order and types are slightly different, so which should be handled correctly later in the instantiation phase.

val replace_make_shared : IR.Tenv.t -> get_formals -> IR.Procname.t -> (IR.Exp.t * IR.Typ.t) list -> replaced