Skip to content

Commit

Permalink
Fix compilation error.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Apr 20, 2020
1 parent b53c7c1 commit 8050fea
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions crates/fuzzing/src/oracles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,28 +169,14 @@ pub fn differential_execution(
}
};

let funcs = module
.exports()
.filter_map(|e| {
if let ExternType::Func(_) = e.ty() {
Some(e.name())
} else {
None
}
})
.collect::<Vec<_>>();

for name in funcs {
for (name, f) in instance.exports().filter_map(|e| {
let name = e.name();
e.into_func().map(|f| (name, f))
}) {
// Always call the hang limit initializer first, so that we don't
// infinite loop when calling another export.
init_hang_limit(&instance);

let f = instance
.get_export(&name)
.expect("instance should have export from module")
.into_func()
.expect("export should be a function");

let ty = f.ty();
let params = match dummy::dummy_values(ty.params()) {
Ok(p) => p,
Expand Down Expand Up @@ -375,7 +361,7 @@ pub fn make_api_calls(api: crate::generators::api::ApiCalls) {

let funcs = instance
.exports()
.filter_map(|e| match e {
.filter_map(|e| match e.into_extern() {
Extern::Func(f) => Some(f.clone()),
_ => None,
})
Expand Down

0 comments on commit 8050fea

Please sign in to comment.