From a0fe240ca48038e6252bd5db1c33507b8f0e49a8 Mon Sep 17 00:00:00 2001 From: Son Ho Date: Thu, 25 Nov 2021 15:52:57 +0100 Subject: Implement the Drop case of eval_statement --- src/Interpreter.ml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Interpreter.ml b/src/Interpreter.ml index 75e97e03..79ec5988 100644 --- a/src/Interpreter.ml +++ b/src/Interpreter.ml @@ -1835,7 +1835,12 @@ let rec eval_statement (config : C.config) (ctx : C.eval_ctx) (st : A.statement) let ctx1, _ = prepare_rplace config Read p ctx in Ok (ctx1, Unit) | A.SetDiscriminant (p, variant_id) -> raise Unimplemented - | A.Drop p -> raise Unimplemented + | A.Drop p -> + let ctx1, v = prepare_lplace config p ctx in + let nv = { v with value = V.Bottom } in + let env2 = write_place_unwrap config Write p nv ctx1.env in + let ctx2 = { ctx with env = env2 } in + Ok (ctx2, Unit) | A.Assert assertion -> raise Unimplemented | A.Call call -> raise Unimplemented | A.Panic -> Error Panic -- cgit v1.2.3