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

Questions Related to the Validation of Raw Input Bytes in C API #6194

Open
mobsceneZ opened this issue Jan 2, 2024 · 1 comment
Open

Questions Related to the Validation of Raw Input Bytes in C API #6194

mobsceneZ opened this issue Jan 2, 2024 · 1 comment

Comments

@mobsceneZ
Copy link
Contributor

Hi developers, I have a problem (or somewhat feature request) related to the C API. Given a raw bytes stream, I need to validate whether it is a valid wasm module or not. In current binaryen-c.h file, we have BinaryenModuleRead and BinaryenModuleValidate to parse raw bytes into a BinaryenModule and validate BinaryenModule respectively.

However, for BinaryenModuleRead, it will exit the process if the input raw bytes are invalid, for BinaryenModuleValidate it will print error messages to the stdout/stderr and requires a BinaryenModuleRef as parameter, so I want to know if there is an API that takes raw bytes as input, returns 1 for valid and 0 for invalid, and does nothing else (just like the WebAssembly.validate() in JS-Wasm API) ?

Thanks in advance for any kind response.

@kripken
Copy link
Member

kripken commented Jan 2, 2024

Looks like there isn't such an API atm. I wouldn't be opposed to adding one if we find a good design for it.

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

No branches or pull requests

2 participants