diff --git a/js/module.ml b/js/module.ml index 4fad03c..70416e3 100644 --- a/js/module.ml +++ b/js/module.ml @@ -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" diff --git a/src/module.ml b/src/module.ml index 2febd4a..3d7316a 100644 --- a/src/module.ml +++ b/src/module.ml @@ -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"