Skip to content

Commit

Permalink
fix return annotations array_expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
bgregoir committed Jul 4, 2023
1 parent e596964 commit d14d6ee
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion compiler/src/compile.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit d14d6ee

Please sign in to comment.