Skip to content

Crash for bit array pattern on JS target #4387

Open
@giacomocavalieri

Description

@giacomocavalieri

This code:

pub fn main() {
  case <<12:size(1)>> {
    <<1.2:float, _>> -> 1
    _ -> 2
  }
}

Throws an exception on the JavaScript target: Error: Invalid bit array slice: start = 0, end = 64, bit size = 1 . It looks like the pattern matching code doesn't check the length of the bit array is sufficient to call the bitArraySliceToFloat function

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions