Gonzalosilvalde opened PR #10500 from Gonzalosilvalde:10437
to bytecodealliance:main
:
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->Description:
This pull request addresses issue #10437 by adding default_value(&self, store: impl AsContextMut) -> Option<T> methods to various Wasm types (e.g., ExternType, GlobalType, MemoryType, ValType, etc.), enabling default value construction for the host API.
Changes:
- Implemented new default_value in different types in types.rs.
- Refactored duplicate code from the fuzzing utility by moving default value construction to these new methods.
- Removed the majority of the code from the wasmtime_fuzzing::oracles::dummy module.
- Modified code that used dummy functions
Additional Notes:
- No documentation comments were added.
- The error in oracles.rs was commented out because the variable e no longer exists.
- For dummy.rs/dummy_linker, a placeholder error “ERROR” has been added, because I didn't know what error to put on it.
- The comment // FIXME #10252 was relocated to the corresponding default_value method implementation.
Gonzalosilvalde requested fitzgen for a review on PR #10500.
Gonzalosilvalde requested wasmtime-core-reviewers for a review on PR #10500.
Gonzalosilvalde requested wasmtime-fuzz-reviewers for a review on PR #10500.
pchickey submitted PR review:
Thanks. Can you fill in the remaining empty doc comments along the lines of my suggestions?
pchickey created PR review comment:
log::warn!("couldn't create import for {import:?}");
pchickey created PR review comment:
/// Construct a default value, if possible for the underlying type. Tags do not have a default value.
pchickey created PR review comment:
/// Construct a default value. Returns None for non-nullable Ref types, which have no default.
pchickey created PR review comment:
/// Construct a func which returns results of default value, if each result type has a default value.
github-actions[bot] commented on PR #10500:
Subscribe to Label Action
cc @fitzgen
<details>
This issue or pull request has been labeled: "fuzzing", "wasmtime:api"Thus the following users have been cc'd because of the following labels:
- fitzgen: fuzzing
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
Gonzalosilvalde updated PR #10500.
pchickey merged PR #10500.
Last updated: Apr 17 2025 at 08:04 UTC