Open btielen opened 2 years ago
That panic is normal you break assumption of take()
please use https://docs.rs/nom/latest/nom/bits/fn.bits.html
when you want use bits API.
Thus, the fact user can too easily construct a tuple and send it to take is error prone, maybe nom need a have a opaque struct for bit api.
Thanks for all the work on this library. I encountered a panic while working with the
nom::bits::complete::take
function. One could argue that I am misusing the take-function, but it panics when the input bit_offset >= 8.Environment
Test case
Example test case:
results in
thread 'main' panicked at 'attempt to shift left with overflow', /home/(...)/.cargo/registry/src/github.com-1ecc6299db9ec823/nom-7.1.1/src/bits/complete.rs:65:14
complete.rs
panics here