Skip to content

Commit 88c2a12

Browse files
committed
fix cfg'ing of gc only code
1 parent bff10fe commit 88c2a12

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

crates/wasmtime/src/runtime/func.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,12 +1010,11 @@ impl Func {
10101010
);
10111011
let mut store = store.as_context_mut();
10121012

1013+
let _need_gc = self.call_impl_check_args(&mut store, params, results)?;
1014+
10131015
#[cfg(feature = "gc")]
1014-
{
1015-
let need_gc = self.call_impl_check_args(&mut store, params, results)?;
1016-
if need_gc {
1017-
store.gc(None);
1018-
}
1016+
if _need_gc {
1017+
store.gc(None);
10191018
}
10201019

10211020
unsafe { self.call_impl_do_call(&mut store, params, results) }
@@ -1156,12 +1155,11 @@ impl Func {
11561155
"cannot use `call_async` without enabling async support in the config",
11571156
);
11581157

1158+
let _need_gc = self.call_impl_check_args(&mut store, params, results)?;
1159+
11591160
#[cfg(feature = "gc")]
1160-
{
1161-
let need_gc = self.call_impl_check_args(&mut store, params, results)?;
1162-
if need_gc {
1163-
store.gc_async(None).await?;
1164-
}
1161+
if _need_gc {
1162+
store.gc_async(None).await?;
11651163
}
11661164

11671165
let result = store

0 commit comments

Comments
 (0)