Skip to content
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: get wasi versions right #2424

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: get wasi versions right
  • Loading branch information
徐敏辉 committed Jun 16, 2021
commit bbe430c4db6438c4d875dbc8cf5a43437e4ca76e
6 changes: 4 additions & 2 deletions lib/wasi/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,19 @@ pub fn get_wasi_versions(module: &Module, strict: bool) -> Option<BTreeSet<WasiV
let mut out = BTreeSet::new();
let imports = module.imports().functions().map(|f| f.module().to_owned());

let mut non_wasi_seen = false;
let mut non_wasi_seen = true;
for ns in imports {
match ns.as_str() {
SNAPSHOT0_NAMESPACE => {
non_wasi_seen = false;
out.insert(WasiVersion::Snapshot0);
}
SNAPSHOT1_NAMESPACE => {
non_wasi_seen = false;
out.insert(WasiVersion::Snapshot1);
}
_ => {
non_wasi_seen = true;
// noop
}
}
}
Expand Down