Skip to content

Commit

Permalink
Add note about super types and finality in matching
Browse files Browse the repository at this point in the history
  • Loading branch information
fitzgen committed Nov 3, 2023
1 parent fdf464d commit c681ad6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/wasmparser/src/readers/core/types/matches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ impl Matches for CoreTypeId {

impl<'a> Matches for WithRecGroup<&'a SubType> {
fn matches(types: &TypeList, a: Self, b: Self, offset: usize) -> Result<bool> {
// NB: matching does not check finality and supertypes. That is checked
// once when we define types, not repeatedly every time we check
// matches.
types.matches(
WithRecGroup::map(a, |a| &a.composite_type),
WithRecGroup::map(b, |b| &b.composite_type),
Expand Down

0 comments on commit c681ad6

Please sign in to comment.