Skip to content
Snippets Groups Projects
Commit bb481ec2 authored by Allan Blanchard's avatar Allan Blanchard
Browse files

[wp] MemVar initialized fixes issue with typing + havoc some variables

parent 7222b10b
No related branches found
No related tags found
Loading
...@@ -168,6 +168,10 @@ let sort_of_object = function ...@@ -168,6 +168,10 @@ let sort_of_object = function
| C_float _ -> Logic.Sreal | C_float _ -> Logic.Sreal
| C_pointer _ | C_comp _ | C_array _ -> Logic.Sdata | C_pointer _ | C_comp _ | C_array _ -> Logic.Sdata
let init_sort_of_object = function
| C_int _ | C_float _ | C_pointer _ -> Logic.Sbool
| C_comp _ | C_array _ -> Logic.Sdata
let sort_of_ctype t = sort_of_object (Ctypes.object_of t) let sort_of_ctype t = sort_of_object (Ctypes.object_of t)
let sort_of_ltype t = match Logic_utils.unroll_type ~unroll_typedef:false t with let sort_of_ltype t = match Logic_utils.unroll_type ~unroll_typedef:false t with
...@@ -402,7 +406,8 @@ struct ...@@ -402,7 +406,8 @@ struct
let sort = function let sort = function
| Mfield(_,_,_,s) -> Qed.Kind.of_tau s | Mfield(_,_,_,s) -> Qed.Kind.of_tau s
| Cfield(f, _) -> sort_of_object (Ctypes.object_of f.ftype) | Cfield(f, KValue) -> sort_of_object (Ctypes.object_of f.ftype)
| Cfield(f, KInit) -> init_sort_of_object (Ctypes.object_of f.ftype)
end end
......
...@@ -1338,6 +1338,8 @@ struct ...@@ -1338,6 +1338,8 @@ struct
let p = Vset.in_range (e_var k) a b in let p = Vset.in_range (e_var k) a b in
let ofs = ofs_shift elt (e_var k) ofs in let ofs = ofs_shift elt (e_var k) ofs in
let obj_x = Ctypes.object_of x.vtype in let obj_x = Ctypes.object_of x.vtype in
let init = e_var (Lang.freshvar ~basename:"v" (init_of_object obj_x)) in
(memvar_set_init seq (Val(m,x,[])) init) ::
Assert(monotonic_initialized seq obj_x x []) :: Assert(monotonic_initialized seq obj_x x []) ::
(assigned_genset seq [k] m x ofs p) (assigned_genset seq [k] m x ofs p)
...@@ -1350,6 +1352,8 @@ struct ...@@ -1350,6 +1352,8 @@ struct
M.assigned (mseq_of_seq seq) obj (Sdescr(xs,mloc_of_path m x ofs,p)) M.assigned (mseq_of_seq seq) obj (Sdescr(xs,mloc_of_path m x ofs,p))
| Val((CVAL|CREF) as m,x,ofs) -> | Val((CVAL|CREF) as m,x,ofs) ->
let obj_x = Ctypes.object_of x.vtype in let obj_x = Ctypes.object_of x.vtype in
let init = e_var (Lang.freshvar ~basename:"v" (init_of_object obj_x)) in
(memvar_set_init seq (Val(m,x,[])) init) ::
Assert(monotonic_initialized seq obj_x x []) :: Assert(monotonic_initialized seq obj_x x []) ::
(assigned_genset seq xs m x ofs p) (assigned_genset seq xs m x ofs p)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment