From 42392c36ca873b7aaa5ef020906e659ee0603170 Mon Sep 17 00:00:00 2001 From: Thomas Letan Date: Thu, 25 Aug 2022 10:56:01 +0200 Subject: [PATCH] WASM: Tickify 'Eval.init' evaluation --- src/lib_webassembly/exec/eval.ml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/lib_webassembly/exec/eval.ml b/src/lib_webassembly/exec/eval.ml index eb1f1d22c248..77e39101acde 100644 --- a/src/lib_webassembly/exec/eval.ml +++ b/src/lib_webassembly/exec/eval.ml @@ -1375,11 +1375,15 @@ let init_step ~module_reg ~self host_funcs (m : module_) (exts : extern list) = | None -> let+ tick = join_step tick in IK_Join_admin (inst0, tick)) + | IK_Eval (inst, {code = _, []; _}) -> + (* No more admin instr, which means that we have returned from + the _start function. *) + Lwt.return (IK_Stop inst) + | IK_Eval (_, {code = _, {it = Trapping msg; at} :: _; _}) -> + Trap.error at msg | IK_Eval (inst, config) -> - (* TODO: https://gitlab.com/tezos/tezos/-/issues/3076 - The call to [eval] should be tickify. *) - let+ (_ : Values.value stack) = eval module_reg config in - IK_Stop inst + let+ config = step module_reg config in + IK_Eval (inst, config) | IK_Stop _ -> raise (Invalid_argument "init_step") let init ~module_reg ~self host_funcs (m : module_) (exts : extern list) : -- GitLab