Skip to content

Commit c951737

Browse files
Add missing gc feature gates (#12074) (#12083)
* add more `gc` feature gates * test debug gc feature combination Co-authored-by: primoly <168267431+primoly@users.noreply.github.com>
1 parent a76984d commit c951737

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,8 @@ jobs:
366366
-p wasmtime --no-default-features --features stack-switching
367367
-p wasmtime --no-default-features --features cranelift,stack-switching
368368
-p wasmtime --no-default-features --features runtime,stack-switching
369+
-p wasmtime --no-default-features --features debug
370+
-p wasmtime --no-default-features --features debug,gc
369371
-p wasmtime --features incremental-cache
370372
-p wasmtime --features profile-pulley
371373
-p wasmtime --all-features

crates/wasmtime/src/runtime/module.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ impl Module {
11321132

11331133
/// Get the text offset (relative PC) for a given absolute PC in
11341134
/// this module.
1135-
#[cfg(any(feature = "gc", feature = "debug"))]
1135+
#[cfg(feature = "gc")]
11361136
pub(crate) fn text_offset(&self, pc: usize) -> u32 {
11371137
u32::try_from(pc - self.inner.module.text().as_ptr() as usize).unwrap()
11381138
}

crates/wasmtime/src/runtime/vm/traphandlers.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use crate::runtime::module::lookup_code;
2121
use crate::runtime::store::{ExecutorRef, StoreOpaque};
2222
use crate::runtime::vm::sys::traphandlers;
2323
use crate::runtime::vm::{InterpreterRef, VMContext, VMStore, VMStoreContext, f32x4, f64x2, i8x16};
24-
#[cfg(feature = "debug")]
24+
#[cfg(all(feature = "debug", feature = "gc"))]
2525
use crate::store::AsStoreOpaque;
2626
use crate::{EntryStoreContext, prelude::*};
2727
use crate::{StoreContextMut, WasmBacktrace};
@@ -830,6 +830,7 @@ impl CallThreadState {
830830
#[cfg(feature = "debug")]
831831
{
832832
let result = match &unwind {
833+
#[cfg(feature = "gc")]
833834
UnwindState::UnwindToWasm(_) => {
834835
assert!(store.as_store_opaque().has_pending_exception());
835836
let exn = store
@@ -838,12 +839,11 @@ impl CallThreadState {
838839
.expect("exception should be set when we are throwing");
839840
store.block_on_debug_handler(crate::DebugEvent::CaughtExceptionThrown(exn))
840841
}
841-
842+
#[cfg(feature = "gc")]
842843
UnwindState::UnwindToHost {
843844
reason: UnwindReason::Trap(TrapReason::Exception),
844845
..
845846
} => {
846-
use crate::store::AsStoreOpaque;
847847
let exn = store
848848
.as_store_opaque()
849849
.pending_exception_owned_rooted()

0 commit comments

Comments
 (0)