Skip to content
Snippets Groups Projects
Commit 413f5980 authored by Patrick Baudin's avatar Patrick Baudin Committed by Patrick Baudin
Browse files

[WP] fixes some points about \exit_status

parent 88263636
No related branches found
No related tags found
No related merge requests found
...@@ -912,7 +912,7 @@ struct ...@@ -912,7 +912,7 @@ struct
let assignable_lval env ~unfold lv = let assignable_lval env ~unfold lv =
match fst lv with match fst lv with
| TResult _ -> [] (* special case ! *) | TResult _ | TVar{lv_name="\\exit_status"} -> [] (* special case ! *)
| _ -> | _ ->
let offsets = let offsets =
let obj = Ctypes.object_of_logic_type (Cil.typeOfTermLval lv) in let obj = Ctypes.object_of_logic_type (Cil.typeOfTermLval lv) in
......
...@@ -449,7 +449,7 @@ and term (env:ctx) (t:term) : model = match t.term_node with ...@@ -449,7 +449,7 @@ and term (env:ctx) (t:term) : model = match t.term_node with
(* --- Lvalues --- *) (* --- Lvalues --- *)
and term_lval env (h,ofs) = match h with and term_lval env (h,ofs) = match h with
| TResult _ -> nothing | TResult _ | TVar{lv_name="\\exit_status"} -> nothing
| TVar( {lv_origin=None ; lv_kind=LVLocal} as lvar) -> | TVar( {lv_origin=None ; lv_kind=LVLocal} as lvar) ->
(* var bound by a \\let *) (* var bound by a \\let *)
load (term_offset env (get_tlet env.local lvar) ofs) load (term_offset env (get_tlet env.local lvar) ofs)
...@@ -470,6 +470,8 @@ and term_offset env (l:model) = function ...@@ -470,6 +470,8 @@ and term_offset env (l:model) = function
and addr_lval env (h,ofs) = match h with and addr_lval env (h,ofs) = match h with
| TResult _ -> Wp_parameters.abort ~current:true "Address of \\result" | TResult _ -> Wp_parameters.abort ~current:true "Address of \\result"
| TVar{lv_name="\\exit_status"} ->
Wp_parameters.abort ~current:true "Address of \\exit_status"
| TMem t -> term_offset env (term env t) ofs | TMem t -> term_offset env (term env t) ofs
| TVar( {lv_origin=Some x} ) -> term_offset env (Loc_var x) ofs | TVar( {lv_origin=Some x} ) -> term_offset env (Loc_var x) ofs
| TVar( {lv_origin=None} as x ) -> | TVar( {lv_origin=None} as x ) ->
......
...@@ -65,7 +65,7 @@ class norm_at (mapping : label_mapping) = ...@@ -65,7 +65,7 @@ class norm_at (mapping : label_mapping) =
| TAddrOf (h, _) | TLval (h, _) | TStartOf (h, _) -> | TAddrOf (h, _) | TLval (h, _) | TStartOf (h, _) ->
let old_label = current_label in let old_label = current_label in
let at_label = match h with let at_label = match h with
| TResult _ -> Some Clabels.post | TResult _ | TVar{lv_name="\\exit_status"} -> Some Clabels.post
| _ -> old_label | _ -> old_label
in in
current_label <- None; current_label <- None;
......
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