-
Notifications
You must be signed in to change notification settings - Fork 252
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
wasm-smith: generate a Module with specific imports and exports? #276
Comments
Yeah, I think adding something like /// Return the available set of imports.
///
/// By default, returns `None` which means that any arbitrary import can be generated.
///
/// To only allow imports from a specific set, override this to return a vec of
/// `(module name, field name, entity type)` describing each available import.
fn available_imports(&self) -> Option<Vec<(String, Option<String>, EntityType)>> {
None
} to the This will require:
Is that enough to get you going? |
Yep, definitelly! I assume vec! is a typo? |
Ah, yes. Fixed with an edit! |
Hi - I'm trying to work through the same change in order to test the WASI syscalls in different runtimes that implement the WASI specification. I'm very new to Rust, however, and so having a few issues creating the Are you implying that let mut choices: Vec<
fn(&mut Unstructured, &mut ConfiguredModule<C>)
-> Result<(String, EntityType)> Thanks in advance for any help! |
I want to generate a wasm module which I can run in a particular environment. That is, I want to specify the set of imports and exports, instead of them being arbitrary.
Context: I want to throw random wasm at the near blockchain, to make sure that our wasm runtime and host functions do not break. I think this should allow me to catch issues a-la wasmerio/wasmer#2329. In that case, an indirect call to an imported function broke things at runtime, and that feels simple enough to be uncovered by a fuzzer.
Is such functionality reasonable/desirable? If it is, I would appreciate mentoring instructions. I think, API-wise, we want to add something like
fn imports(&self) -> Option<&[Import]>
to theConfig
trait, but I am not familiar with wasm-tools enough to understand what would be the best definition for such anImport
type.The text was updated successfully, but these errors were encountered: