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

wasmparser: Missing options in WasmFeatures #481

Closed
3 tasks
Robbepop opened this issue Feb 13, 2022 · 2 comments · Fixed by #482
Closed
3 tasks

wasmparser: Missing options in WasmFeatures #481

Robbepop opened this issue Feb 13, 2022 · 2 comments · Fixed by #482

Comments

@Robbepop
Copy link
Collaborator

Robbepop commented Feb 13, 2022

Currently the WasmFeatures struct in the wasmparser crate has many options for controlling single Wasm proposal implementations.
However, some Wasm proposals such as nontrapping-float-to-int-instructions, sign-extension-ops and mutable-global are missing from there.

Is this intentional? If yes, what is the reason?

If not, would the authors of the wasmparser crate like to receive PRs to add those configuration options so that wasmparser can be used to validate against Wasm inputs making use of those features?

Motivation

For some use cases it might be very important to guard against usage of certain unsupported Wasm proposals. An example for this is in the context where Wasm instructions are metered and there is no defined metering for certain instructions of Wasm proposals.

ToDo

  • Add mutable_global: bool field to WasmFeatures to enable or disable the mutable-global Wasm proposal.
  • Add nontrapping_float_to_int_instructions: bool field to WasmFeatures to enable or disable the nontrapping-float-to-int-instructions Wasm proposal.
  • Add sign_extension_ops: bool field to WasmFeatures to enable or disable the sign-extension-ops Wasm proposal.
@Robbepop Robbepop changed the title Missing options in WasmFeatures wasmparser: Missing options in WasmFeatures Feb 13, 2022
@alexcrichton
Copy link
Member

I think this is mostly because those proposals were largely stable before they were added here, but it should be fine to retroactively add them if necessary.

@Robbepop
Copy link
Collaborator Author

Robbepop commented Feb 14, 2022

Okay, I added some TODOs to the initial comment and am looking to tackle this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants