From 147b156a29c64f625ad94592d4970659c46cea73 Mon Sep 17 00:00:00 2001 From: rina Date: Wed, 14 Feb 2024 11:03:47 +1000 Subject: [PATCH] aslp-server: lazy aarch64_evaluation_environment. --- bin/server.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/server.ml b/bin/server.ml index 220e9b8d..ebfb90c7 100644 --- a/bin/server.ml +++ b/bin/server.ml @@ -15,12 +15,13 @@ open Asl_utils open Lwt -let persistent_env = Option.get (aarch64_evaluation_environment ()) +let persistent_env = lazy (Option.get (aarch64_evaluation_environment ())) let eval_instr (opcode: string) : string = let pp_raw stmt : string = Utils.to_string (Asl_parser_pp.pp_raw_stmt stmt) |> String.trim in let address = None in - let stmts : Asl_ast.stmt list = Dis.retrieveDisassembly ?address persistent_env (Dis.build_env persistent_env) opcode in + let env' = Lazy.force persistent_env in + let stmts : Asl_ast.stmt list = Dis.retrieveDisassembly ?address env' (Dis.build_env env') opcode in let stmts' = List.map pp_raw stmts in String.concat "\n" stmts'