Skip to content

Commit 8050fea

Browse files
committed
Fix compilation error.
1 parent b53c7c1 commit 8050fea

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

crates/fuzzing/src/oracles.rs

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -169,28 +169,14 @@ pub fn differential_execution(
169169
}
170170
};
171171

172-
let funcs = module
173-
.exports()
174-
.filter_map(|e| {
175-
if let ExternType::Func(_) = e.ty() {
176-
Some(e.name())
177-
} else {
178-
None
179-
}
180-
})
181-
.collect::<Vec<_>>();
182-
183-
for name in funcs {
172+
for (name, f) in instance.exports().filter_map(|e| {
173+
let name = e.name();
174+
e.into_func().map(|f| (name, f))
175+
}) {
184176
// Always call the hang limit initializer first, so that we don't
185177
// infinite loop when calling another export.
186178
init_hang_limit(&instance);
187179

188-
let f = instance
189-
.get_export(&name)
190-
.expect("instance should have export from module")
191-
.into_func()
192-
.expect("export should be a function");
193-
194180
let ty = f.ty();
195181
let params = match dummy::dummy_values(ty.params()) {
196182
Ok(p) => p,
@@ -375,7 +361,7 @@ pub fn make_api_calls(api: crate::generators::api::ApiCalls) {
375361

376362
let funcs = instance
377363
.exports()
378-
.filter_map(|e| match e {
364+
.filter_map(|e| match e.into_extern() {
379365
Extern::Func(f) => Some(f.clone()),
380366
_ => None,
381367
})

0 commit comments

Comments
 (0)