From f81c8732b9dcfab6f3df5030545027dad342fe6a Mon Sep 17 00:00:00 2001 From: Daniel Larraz Date: Fri, 6 Oct 2023 10:33:46 -0500 Subject: [PATCH] Do not assume dummy node id exists --- src/lustre/lustreAbstractInterpretation.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lustre/lustreAbstractInterpretation.ml b/src/lustre/lustreAbstractInterpretation.ml index 8f5274d9a..65f4ae2f2 100644 --- a/src/lustre/lustreAbstractInterpretation.ml +++ b/src/lustre/lustreAbstractInterpretation.ml @@ -716,7 +716,11 @@ let rec interpret_global_consts ty_ctx decls = Res.seq_ (check_global_const_subrange ty_ctx ctx pos_map) and check_global_const_subrange ty_ctx ctx pos_map = - let ctx = IMap.find dnode_id ctx in + let ctx = + match IMap.find_opt dnode_id ctx with + | None -> empty_context + | Some ctx -> ctx + in IMap.fold (fun id inferred_range acc -> let actual_ty = Ctx.lookup_ty ty_ctx id |> get in let actual_ty = Ctx.expand_nested_type_syn ty_ctx actual_ty in