-
Notifications
You must be signed in to change notification settings - Fork 790
wasm2c: support final (non-SIMD) spec tests by adding an unsafe "ignore validation failure" flag #1888
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
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Exports of a module instance are accessed through a pointer to the instance and a function that returns a pointer to the thing being exported form the corresponding instance. This change enables each module instance to have their own exports.
* Remove name mangling of types and WASM_RT_ADD_PREFIX, instead all exported symbols have mangled module name as their prefix * Add modname_import_t which contains all imported globals, memories and tables * Add pointers to module instances of every module that the current module import a function from * Add a pointer to module intance to wasm_rt_elem_t * Pass corresponding module instance pointer to imported functions: pointer to where the funcion is imported from for CallExpr and pointer from wasm_rt_elem_t for CallIndirectExpr * init_func_type() is moved to init_module() which needs to be called before any instance of the module is used
* modname_init() takes pointers to each module instance that the module imports from and set up imported globals, memories and tables correspondently * Memories, tables and globals of spectest are moved into spectest_module_instance. Functions and exports of spectest module is set up to perform the same way as wasm2c output modules * Only one declaration is written to output header file if the same field form the same module is imported multiple times
…ame_instance_t*) modname_free(modname_instance_t*) frees all non-imported tables and memories in the given module_instance
This makes sure it's not possible to initialize a module while leaving the runtime (in practice, the signal handler) uninitialized.
6b35e6e to
0a8017b
Compare
0a8017b to
de0a011
Compare
Restores current versions of all non-SIMD core tests and multi-memory tests, except for two that are failing: ref_func.wast and unreached-valid.wast These two tests produce similar errors when run under run-interp-spec, so will require further debugging.
To pass the ref_func.wasm and unreached-valid.wast tests, wasm2c needs to be willing to continue translating a module that has failed to validate. (The interpreter seems to handle this similarly.) Expose this behavior in wasm2c behind a `--unsafe-ignore-validation-failure` flag, and add the final two missing tests.
de0a011 to
d48e0ee
Compare
This was referenced Apr 6, 2022
Member
Author
|
I'm going to close this -- per #1894, the better approach is probably to fix the underlying issues that are causing these modules to fail validation. After d08b0d9, the only remaining case involves validating |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(This PR is sequenced behind
#1875,#1814, #1877, and #1887.)To pass the ref_func.wasm and unreached-valid.wast tests (the final missing non-SIMD spec tests in the core testsuite), wasm2c needs to be willing to continue translating a module that has failed to validate. (The interpreter doesn't seem to enforce validity as strictly.)
Expose this behavior in wasm2c behind a
--unsafe-ignore-validation-failureflag, and add the final two missing tests.