Current implementation fails on streaming validation due to interpreting 0x020x0b as block with type 11 which doesn't exist; so add enough types such that 0x0b resolves to a valid one, thereby passing validation and erroring at the expected state.
Suggestions for making this more realistic or safe welcome! I'm a bit concerned about adding so many duplicate types in here but I don't believe that's illegal according to spec. My first pass at this changed the first 0x0b to an 0x00 but that breaks the realism a bit too much since you need the 3 breaks and the wild 0x00 makes no sense. The test is trying to get at the br_table having a missing byte.
Current implementation fails on streaming validation due to interpreting
0x020x0b
as block with type 11 which doesn't exist; so add enough types such that0x0b
resolves to a valid one, thereby passing validation and erroring at the expected state.This was previously reported in https://github.com/WebAssembly/spec/issues/1355 but never fixed, and I've just discovered it for myself.
Suggestions for making this more realistic or safe welcome! I'm a bit concerned about adding so many duplicate types in here but I don't believe that's illegal according to spec. My first pass at this changed the first
0x0b
to an0x00
but that breaks the realism a bit too much since you need the 3 breaks and the wild0x00
makes no sense. The test is trying to get at the br_table having a missing byte.