jonas-k/coremidi-sys

Unaligned read of `MIDIPacket::length` triggers UB check in recent Rust

Closed this issue · 0 comments

See chris-zen/coremidi#49.

Because MIDIPackets are unaligned on non-ARM platforms, accesing their length and timeStamp fields must happen through read_unaligned. But this is not needed (and would produce worse machine code) on ARM.

These checks have been added in Rust 1.70 (https://releases.rs/docs/1.70.0/, rust-lang/rust#98112).