diff --git a/src/lib_webassembly/exec/eval.ml b/src/lib_webassembly/exec/eval.ml index eb1f1d22c248aa609abf031621e183c387e44678..77e39101acdeae4cc3eac40fe117466150a0e58a 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) :