Skip to content

Commit

Permalink
CN VIP: Clarify pointer to int
Browse files Browse the repository at this point in the history
  • Loading branch information
dc-mak committed Sep 25, 2024
1 parent 6cc779a commit 3bac7c6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/cn/lib/check.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,12 @@ let rec check_expr labels (e : BT.t Mu.mu_expr) (k : IT.t -> unit m) : unit m =
let@ () = ensure_base_type loc ~expect:(Loc ()) (Mu.bt_of_pexpr pe) in
check_pexpr pe (fun arg ->
let actual_value = cast_ (Memory.bt_of_sct act_to.ct) arg loc in
(* after discussing with Kavyan *)
(* NOTE: After discussing with Kavyan
(1) The pointer does NOT need to be live. The PNVI/VIP
formalisations are missing a rule for the dead pointer case.
The PNVI rules state that the pointer must be live so that
allocations are exposed.
(2) So, the only UB possible is unrepresentable results. *)
let@ provable = provable loc in
let here = Locations.other __FUNCTION__ in
let lc = LC.T (representable_ (act_to.ct, arg) here) in
Expand Down

0 comments on commit 3bac7c6

Please sign in to comment.