Skip to content

Commit

Permalink
Fix indexing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mshinwell committed Dec 5, 2024
1 parent 5c5fbfb commit ea64722
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1066,8 +1066,7 @@ let rec array_load_unsafe ~array ~index ~(mut : Lambda.mutable_flag) array_kind
let unarized = List.concat_map unarize_kind array_ref_kinds in
let index : H.expr_primitive =
let multiplier =
List.length array_ref_kinds
|> Targetint_31_63.of_int |> Simple.const_int
List.length unarized |> Targetint_31_63.of_int |> Simple.const_int
in
Binary (Int_arith (Tagged_immediate, Mul), index, Simple multiplier)
in
Expand Down Expand Up @@ -1135,8 +1134,7 @@ let rec array_set_unsafe dbg ~array ~index array_kind
let unarized = List.concat_map unarize_kind array_set_kinds in
let index : H.expr_primitive =
let multiplier =
List.length array_set_kinds
|> Targetint_31_63.of_int |> Simple.const_int
List.length unarized |> Targetint_31_63.of_int |> Simple.const_int
in
Binary (Int_arith (Tagged_immediate, Mul), index, Simple multiplier)
in
Expand Down

0 comments on commit ea64722

Please sign in to comment.