pub struct TableGuards {
pub table_size: Option<u32>,
pub base_byte_offset: Option<u32>,
pub type_reject: Vec<Option<String>>,
pub has_null_slots: bool,
pub runtime_type_check: bool,
}Expand description
#642/#650: one table’s call_indirect guard inputs — see
CallIndirectGuards for the layout contract and soundness argument.
Fields§
§table_size: Option<u32>Compile-time size of this table (entries); None = no sound bound
known (an imported table with growable limits).
base_byte_offset: Option<u32>#650: byte offset of this table’s base within the contiguous R11
region — sum(size(0..N)) * 4, a compile-time constant. None when
any PRECEDING table’s size is unknown (the base is then not a
compile-time constant and the lowering declines).
type_reject: Vec<Option<String>>Per expected-type index: None = closed-world type property VERIFIED
against THIS table; Some(reason) = not verifiable (the lowering
declines).
has_null_slots: bool#664: whether this table’s image contains at least one uninitialized
(null funcref) slot. WASM Core §4.4.8 requires a call_indirect
reaching a null slot to TRAP — the closed-world type check verifies
the INITIALIZED slots only, and the lowering must emit a runtime
null check (pointer == 0 → trap) before the indirect branch when
this is set. false for a fully-initialized table keeps today’s
exact dispatch bytes (no null check) BY CONSTRUCTION. Only
meaningful when the type verdict is None (verified); reject paths
decline before it is consulted.
runtime_type_check: bool#676: this table’s image is statically known but HETEROGENEOUS — its
initialized slots span at least two distinct STRUCTURAL signature
classes, so no expected type’s closed world can hold
(type_reject[t] is Some for every t) — yet the mismatch trap
(WASM Core §4.4.8) IS dischargeable at runtime: the type-id sidecar
(see CallIndirectGuards) carries each slot’s structural class id,
and the dispatch compares the indexed slot’s id against the expected
type’s class id (a compile-time immediate), trapping on inequality.
When set (and CallIndirectGuards::type_ids_byte_offset is known),
the lowering emits that runtime check INSTEAD of declining. false
keeps the pre-#676 behavior: verified tables dispatch unchecked
(byte-identical), unverifiable tables decline.
Trait Implementations§
Source§impl Clone for TableGuards
impl Clone for TableGuards
Source§fn clone(&self) -> TableGuards
fn clone(&self) -> TableGuards
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TableGuards
impl Debug for TableGuards
Source§impl Default for TableGuards
impl Default for TableGuards
Source§fn default() -> TableGuards
fn default() -> TableGuards
impl Eq for TableGuards
Source§impl PartialEq for TableGuards
impl PartialEq for TableGuards
impl StructuralPartialEq for TableGuards
Auto Trait Implementations§
impl Freeze for TableGuards
impl RefUnwindSafe for TableGuards
impl Send for TableGuards
impl Sync for TableGuards
impl Unpin for TableGuards
impl UnsafeUnpin for TableGuards
impl UnwindSafe for TableGuards
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.