-
Notifications
You must be signed in to change notification settings - Fork 824
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
fix(runtime-core) Remove a panic when generating globals with a corrupted module #995
Merged
Conversation
This file contains 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
Fix wasmerio#979. When we try to get a global that doesn't exist, a panic is generated. This patch just skip that path, and let a proper error be generated later. With this patch, we get: ```sh $ cargo run -- run panic_index_oob_all_backends.wasm Error: ExportNotFound { name: "main" } ``` which is kind of the expected behavior in such situation.
Before this patch: ``` $ cargo run -- run panic_index_oob_all_backends.wasm Error: ExportNotFound { name: "main" } ``` With this patch: ```sh $ cargo run -- run panic_index_oob_all_backends.wasm Error: Can't instantiate module: LinkError([Generic { message: "Trying to read the `0` global that isn\'t properly initialized." }]) ```
Hywan
added
bug
Something isn't working
📦 lib-deprecated
About the deprecated crates
labels
Nov 21, 2019
Hywan
changed the title
fix(runtime-core) Fix a panic when generating globals with a corrupted module
fix(runtime-core) Remove a panic when generating globals with a corrupted module
Nov 21, 2019
bors try |
tryBuild succeeded |
syrusakbary
approved these changes
Nov 21, 2019
bors r+ |
bors bot
added a commit
that referenced
this pull request
Nov 21, 2019
995: fix(runtime-core) Remove a panic when generating globals with a corrupted module r=syrusakbary a=Hywan Fix #979. When we try to get a global that doesn't exist, a panic is generated. This patch skips such panic and let a proper error be generated. Before this patch: ``` $ cargo run -- run panic_index_oob_all_backends.wasm Error: ExportNotFound { name: "main" } ``` With this patch: ```sh $ cargo run -- run panic_index_oob_all_backends.wasm Error: Can't instantiate module: LinkError([Generic { message: "Trying to read the `0` global that isn\'t properly initialized." }]) ``` Co-authored-by: Ivan Enderlin <[email protected]>
Build succeeded |
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.
Fix #979.
When we try to get a global that doesn't exist, a panic is
generated. This patch skips such panic and let a proper error be
generated.
Before this patch:
With this patch: