Fix regression with unaligned u8#294
Conversation
|
Looks like the CI errors for miri occur on master also |
|
Thanks for fixing the case for an offset of 4, but it seems like using an offset of 2 still causes it to fail: let test_data: &[u8] = [0b11000000, 0b00111111].as_ref();
#[derive(Debug, PartialEq, DekuRead)]
#[deku(endian = "little")]
struct Container {
#[deku(bits = 2)]
field1: u8,
field2: u8,
#[deku(bits = 6)]
field3: u8,
}
assert_eq!(
Container::from_bytes((test_data, 0)).unwrap().1,
Container {
field1: 0b11,
field2: 0,
field3: 0b111111,
}
);Adding in an explicit |
I'll fix this tonight, turns out I was over eager with removing some code and need to align the bits properly. Thanks for catching this. I'd like to add an |
* Add logic to fix alignment when needed * Add tests for regression testing
02d65fa to
d08fdd5
Compare
sharksforarms
left a comment
There was a problem hiding this comment.
Thanks @wcampbell0x2a, changes and tests look good to me.
See #292