Compare commits

..

3 commits

Author SHA1 Message Date
Théophile Bastian 2b2d44c18e csmith/check_gen_eh_frame: verbose mode 2019-04-03 12:19:53 +02:00
Théophile Bastian 30fe23b541 Fix rbp to rsp switch
Use rsp+16, because we'll pop the saved rbp from the stack just after
2019-04-03 12:19:53 +02:00
Théophile Bastian 180e32a4b3 Generate RBP column when needed 2019-04-03 12:19:49 +02:00

View file

@ -36,6 +36,7 @@ type subroutine_cfa_map = subroutine_cfa_data StrMap.t
module TIdMap = Map.Make(BStd.Tid)
exception InvalidSub
exception UnexpectedRbpSet
let pp_cfa_pos ppx = function
| RspOffset off -> Format.fprintf ppx "RSP + (%s)" (Int64.to_string off)
@ -357,7 +358,11 @@ let process_def (local_state: block_local_state) def (cur_reg: reg_pos)
if (BStd.Var.name @@ BStd.Def.lhs def = "mem"
&& is_rbp_save_expr (BStd.Def.rhs def) cur_state)
then
Some (RbpCfaOffset Int64.zero) (* TODO *)
(match cur_cfa with
| RspOffset off ->
Some (RbpCfaOffset (Int64.mul Int64.minus_one off))
| _ -> raise UnexpectedRbpSet
)
else
None
in