Skip to content

Commit

Permalink
Fix support for native profiling (#6435)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
alexcrichton committed May 22, 2023
1 parent a186e47 commit d0a6e91
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/jit/src/instantiate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Item = (DefinedFuncIndex, &[u8])> + '_ {
) -> impl Iterator<Item = (DefinedFuncIndex, &[u8])> + '_ {
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.
Expand All @@ -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<Item = (DefinedFuncIndex, &[u8])> + '_ {
) -> impl Iterator<Item = (DefinedFuncIndex, &[u8])> + '_ {
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.
Expand Down

0 comments on commit d0a6e91

Please sign in to comment.