Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: Make features work in 32-bit mode (#123)
  • Loading branch information
ospencer committed Jan 16, 2022
1 parent d89d7d1 commit e435c8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion js/module.ml
Expand Up @@ -74,7 +74,9 @@ let get_features wasm_mod =
feature :: split_features (feature lsr 1)
| feature -> split_features (feature lsr 1)
in
split_features 0x80000000
(* Support 32-bit OCaml where integers are 31 bits *)
(* This supports up to 31 Binaryen features *)
split_features 0x40000000

let set_features wasm_mod features =
meth_call wasm_mod "setFeatures"
Expand Down
4 changes: 3 additions & 1 deletion src/module.ml
Expand Up @@ -85,7 +85,9 @@ let get_features wasm_mod =
feature :: split_features (feature lsr 1)
| feature -> split_features (feature lsr 1)
in
split_features 0x80000000
(* Support 32-bit OCaml where integers are 31 bits *)
(* This supports up to 31 Binaryen features *)
split_features 0x40000000

external set_features : t -> int -> unit = "caml_binaryen_module_set_features"

Expand Down

0 comments on commit e435c8b

Please sign in to comment.