summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSon Ho2022-02-08 19:00:28 +0100
committerSon Ho2022-02-08 19:00:28 +0100
commit2145c29ba8d7727f104da83c6be57bf2f3f408d5 (patch)
tree47f72673eeed359682e468eb71c3b62d42065395 /src
parent7e153990e307b2d83c00a333a91882317f9b16fc (diff)
Make a minor modification to `drop_value`
Diffstat (limited to 'src')
-rw-r--r--src/InterpreterStatements.ml7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/InterpreterStatements.ml b/src/InterpreterStatements.ml
index 375f3dec..5565a98f 100644
--- a/src/InterpreterStatements.ml
+++ b/src/InterpreterStatements.ml
@@ -24,13 +24,16 @@ let log = L.statements_log
let drop_value (config : C.config) (p : E.place) : cm_fun =
fun cf ctx ->
log#ldebug (lazy ("drop_value: place: " ^ place_to_string ctx p));
- (* Prepare the place (by ending the outer loans and the borrows) *)
+ (* Prepare the place (by ending the outer loans and the borrows).
+ * Note that [prepare_lplace] will use the `Write` access kind:
+ * it is ok, because when updating the value with [Bottom] below,
+ * we will use the `Move` access *)
let end_borrows = true in
let prepare = prepare_lplace config end_borrows p in
(* Replace the value with [Bottom] *)
let replace cf (v : V.typed_value) ctx =
let nv = { v with value = V.Bottom } in
- let ctx = write_place_unwrap config Write p nv ctx in
+ let ctx = write_place_unwrap config Move p nv ctx in
cf ctx
in
(* Compose and apply *)