Use the variable type to add or not an indirection
This commit is contained in:
parent
f45e30d207
commit
bb6b9868b0
|
@ -229,15 +229,11 @@ and create_affect_stm dest src ty =
|
||||||
|
|
||||||
(** Returns the expression to use e as an argument of
|
(** Returns the expression to use e as an argument of
|
||||||
a function expecting a pointer as argument. *)
|
a function expecting a pointer as argument. *)
|
||||||
let address_of e =
|
let address_of ty e =
|
||||||
(* try *)
|
|
||||||
let lhs = lhs_of_exp e in
|
let lhs = lhs_of_exp e in
|
||||||
match lhs with
|
match ty with
|
||||||
| Carray _ -> Clhs lhs
|
| Tarray _ -> Clhs lhs
|
||||||
| Cderef lhs -> Clhs lhs
|
|
||||||
| _ -> Caddrof lhs
|
| _ -> Caddrof lhs
|
||||||
(* with _ ->
|
|
||||||
e *)
|
|
||||||
|
|
||||||
let rec cexpr_of_static_exp se =
|
let rec cexpr_of_static_exp se =
|
||||||
match se.se_desc with
|
match se.se_desc with
|
||||||
|
@ -369,7 +365,7 @@ let step_fun_call var_env sig_info objn out args =
|
||||||
| [], [] -> []
|
| [], [] -> []
|
||||||
| e::l, ad::ads ->
|
| e::l, ad::ads ->
|
||||||
(*this arg is targeted, use a pointer*)
|
(*this arg is targeted, use a pointer*)
|
||||||
let e = if Linearity.is_linear ad.a_linearity then address_of e else e in
|
let e = if Linearity.is_linear ad.a_linearity then address_of ad.a_type e else e in
|
||||||
e::(add_targeting l ads)
|
e::(add_targeting l ads)
|
||||||
| _, _ -> assert false
|
| _, _ -> assert false
|
||||||
in
|
in
|
||||||
|
|
Loading…
Reference in a new issue