Skip to content

Commit 634c287

Browse files
committed
Record post_return only if it exists
1 parent 7c41b1c commit 634c287

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • crates/wasmtime/src/runtime/component

crates/wasmtime/src/runtime/component/func.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -733,11 +733,6 @@ impl Func {
733733

734734
fn post_return_impl(&self, mut store: impl AsContextMut) -> Result<()> {
735735
let mut store = store.as_context_mut();
736-
component_hooks::record_wasm_func_post_return(
737-
self.instance.id().instance(),
738-
self.index,
739-
&mut store,
740-
)?;
741736

742737
let index = self.index;
743738
let vminstance = self.instance.id().get(store.0);
@@ -791,6 +786,11 @@ impl Func {
791786
// intentionally leaves the instance in a "poisoned" state where it
792787
// can no longer be entered because `may_enter` is `false`.
793788
if let Some(func) = post_return {
789+
component_hooks::record_wasm_func_post_return(
790+
self.instance.id().instance(),
791+
self.index,
792+
&mut store,
793+
)?;
794794
crate::Func::call_unchecked_raw(
795795
&mut store,
796796
func,

0 commit comments

Comments
 (0)