Comments (5)
Hm, I'm pretty sure that module_new performs validation in the V8 prototype (it essentially invokes the JS WebAssembly.Module constructor). That's the intention anyway.
Should the API also provide unchecked versions?
from wasm-c-api.
In V8, I assume wasm_module_new
is returning null when the module data is invalid?
As a user of the C API, my assumption was that wasm_module_new
would validate and would return null on invalid module data; if that is indeed the case then I think we should document that behavior and fix Wasmtime to behave the same way.
👍 on having adding an "unchecked" version that skips validation (if possible) since wasm_module_validate
exists.
from wasm-c-api.
@peterhuene, yes, you should get null. Any factory methods can return null. And yes, there should be documentation of that fact -- any documentation whatsoever, for that matter. :)
The wasm_module_new and _validate functions should also have an optional out parameter for getting possible error reports in some form.
from wasm-c-api.
Thanks for the confirmation. That's what my use of the C API was assuming.
@sunfishcode I think we should fix this in Wasmtime to validate for wasm_module_new
then.
from wasm-c-api.
@peterhuene Agreed. I'll close the issue here, and follow up on the Wasmtime side.
from wasm-c-api.
Related Issues (20)
- Embedding multiple engines implementing wasm C API HOT 3
- undefined reference to `wasm::vec<char>::free_data()'
- Syslog HOT 2
- Custom Sections API HOT 4
- WASM proposals supporting in Wasm C API HOT 1
- API to Terminate Execution for a wasm::Store
- Expectations for serialize/deserialize HOT 4
- make error:error: use of undeclared identifier 'errc' struct is_error_condition_enum<errc> HOT 1
- docker build fails in C++ Multi test HOT 2
- AddressSanitizer: allocation-size-too-big HOT 3
- Access of v8 isolate possible? HOT 1
- Deprecate wasm-c-api on big-endian hosts HOT 12
- Support import globals callback HOT 6
- posix shared memory with wamr
- Metering API
- `vec<T>::make_nt` may not be so helpful HOT 1
- Please tag when used in wabt
- memory64 support
- Type constructors should have a `wasm_engine_t*` parameter HOT 10
- How to import a native func to "env"? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wasm-c-api.