Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Make features work in 32-bit mode #123

Merged
merged 1 commit into from Jan 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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