From d0a6e916d2e086f72a235a6776cc58977002c73e Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 22 May 2023 17:11:37 -0500 Subject: [PATCH] Fix support for native profiling (#6435) This commit fixes a panic that's easy to hit with native profilers by accident. This was introduced in #6262 which made it into the 9.0.0 release but is not present on `main` due to the refactorings of #6361 which are on `main` but not on 9.0.0. Closes #6433 --- crates/jit/src/instantiate.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/jit/src/instantiate.rs b/crates/jit/src/instantiate.rs index b5f0daf82bf9..8c8740d66d2d 100644 --- a/crates/jit/src/instantiate.rs +++ b/crates/jit/src/instantiate.rs @@ -568,10 +568,10 @@ impl CompiledModule { /// this module, providing both their index and their in-memory body. pub fn array_to_wasm_trampolines( &self, - ) -> impl ExactSizeIterator + '_ { + ) -> impl Iterator + '_ { self.funcs .keys() - .map(move |i| (i, self.array_to_wasm_trampoline(i).unwrap())) + .filter_map(move |i| Some((i, self.array_to_wasm_trampoline(i)?))) } /// Get the native-to-Wasm trampoline for the function `index` points to. @@ -590,10 +590,10 @@ impl CompiledModule { /// this module, providing both their index and their in-memory body. pub fn native_to_wasm_trampolines( &self, - ) -> impl ExactSizeIterator + '_ { + ) -> impl Iterator + '_ { self.funcs .keys() - .map(move |i| (i, self.native_to_wasm_trampoline(i).unwrap())) + .filter_map(move |i| Some((i, self.native_to_wasm_trampoline(i)?))) } /// Get the Wasm-to-native trampoline for the given signature.