From e5abcd9378c30420d3a86c81a63b6eaf7a685c4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Basile=20Cl=C3=A9ment?= Date: Fri, 17 Nov 2023 09:37:40 +0100 Subject: [PATCH] fix: Make --profiling not crash As noted in https://github.com/OCamlPro/alt-ergo/issues/935 the --profiling option currently makes Alt-Ergo instantly crash because in https://github.com/OCamlPro/alt-ergo/pull/863 we forgot a slot for the last element in the array. This patch fixes that. --- src/lib/util/timers.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/util/timers.ml b/src/lib/util/timers.ml index bb9df94dd..0edeb3aab 100644 --- a/src/lib/util/timers.ml +++ b/src/lib/util/timers.ml @@ -186,8 +186,8 @@ end = struct let create () = Array.init - max_ty_module - (fun _ -> Array.init max_ty_function (fun _ -> 0.)) + (max_ty_module + 1) + (fun _ -> Array.init (max_ty_function + 1) (fun _ -> 0.)) let clear = Array.iter (fun a -> Array.iteri (fun j _ -> a.(j) <- 0.) a)