From d14d6ee96fc7181993172a1691c1ab0c7c19a9af Mon Sep 17 00:00:00 2001 From: Benjamin Gregoire Date: Tue, 4 Jul 2023 09:00:33 +0200 Subject: [PATCH] fix return annotations array_expansion --- compiler/src/compile.ml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler/src/compile.ml b/compiler/src/compile.ml index 31b6d8c5f..db79bc61c 100644 --- a/compiler/src/compile.ml +++ b/compiler/src/compile.ml @@ -161,7 +161,13 @@ let compile (type reg regx xreg rflag cond asm_op extra_op) | _ -> fd.f_cc in - let finfo = fd.f_loc, fd.f_annot, f_cc, fd.f_outannot in + let do_outannot x a = + try + let (_, va) = Hv.find harrs (L.unloc x) in + List.init (Array.length va) (fun _ -> []) + with Not_found -> [a] in + let f_outannot = List.flatten (List.map2 do_outannot fd.f_ret fd.f_outannot) in + let finfo = fd.f_loc, fd.f_annot, f_cc, f_outannot in { Array_expansion.vars = vars; arrs = !arrs; finfo } in