diff --git a/crates/wasmparser/src/validator/types.rs b/crates/wasmparser/src/validator/types.rs index d8bce0b8a8..9898608bd5 100644 --- a/crates/wasmparser/src/validator/types.rs +++ b/crates/wasmparser/src/validator/types.rs @@ -995,7 +995,7 @@ impl TypeList { let depth = self .core_type_to_depth .as_ref() - .expect("cannot get subtype depth from a committed list")[id.index()]; + .expect("cannot get subtype depth from a committed list")[&id]; debug_assert!(usize::from(depth) <= crate::limits::MAX_WASM_SUBTYPING_DEPTH); depth }