From 111af7db1d5dbc245bc72864c3577b6bcabcb3d7 Mon Sep 17 00:00:00 2001 From: Son Ho Date: Mon, 29 Nov 2021 22:11:47 +0100 Subject: Start fixing bugs in the unit test evaluation --- src/Interpreter.ml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/Interpreter.ml') diff --git a/src/Interpreter.ml b/src/Interpreter.ml index 75be6074..a49b2f3f 100644 --- a/src/Interpreter.ml +++ b/src/Interpreter.ml @@ -23,7 +23,8 @@ let eval_ctx_to_string = Print.Contexts.eval_ctx_to_string let statement_to_string = Print.EvalCtxCfimAst.statement_to_string -let expression_to_string = Print.EvalCtxCfimAst.expression_to_string +let expression_to_string ctx = + Print.EvalCtxCfimAst.expression_to_string ctx " " " " (* TODO: move *) let mk_unit_ty : T.ety = T.Tuple [] @@ -2367,6 +2368,11 @@ let test_unit_function (type_defs : T.type_def T.TypeDefId.vector) } in + (* Put the (uninitialized) local variables *) + let ctx = + C.ctx_push_uninitialized_vars ctx (V.VarId.vector_to_list fdef.A.locals) + in + (* Evaluate the function *) let config = { C.mode = C.ConcreteMode; C.check_invariants = true } in match eval_function_body config ctx fdef.A.body with -- cgit v1.2.3