Skip to content

Commit

Permalink
[hl] Use tclass option for array i64
Browse files Browse the repository at this point in the history
It is None if hl-legacy32 is defined
  • Loading branch information
tobil4sk committed Jan 16, 2025
1 parent be03c8b commit 0f02947
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/generators/genhl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ type array_impl = {
ai32 : tclass;
af32 : tclass;
af64 : tclass;
ai64 : tclass;
ai64 : tclass option;
}

type constval =
Expand Down Expand Up @@ -289,7 +289,10 @@ let array_class ctx t =
| HF64 ->
ctx.array_impl.af64
| HI64 ->
ctx.array_impl.ai64
begin match ctx.array_impl.ai64 with
| None -> die "" __LOC__
| Some c -> c
end
| HDyn ->
ctx.array_impl.adyn
| _ ->
Expand Down Expand Up @@ -4153,7 +4156,7 @@ let create_context com dump =
ai32 = get_class "ArrayBytes_Int";
af32 = get_class "ArrayBytes_hl_F32";
af64 = get_class "ArrayBytes_Float";
ai64 = get_class (if Gctx.raw_defined com "hl_legacy32" then "ArrayBytes_Int" else "ArrayBytes_hl_I64");
ai64 = if Gctx.raw_defined com "hl_legacy32" then None else Some (get_class "ArrayBytes_hl_I64");
};
base_class = get_class "Class";
base_enum = get_class "Enum";
Expand Down

0 comments on commit 0f02947

Please sign in to comment.