a2aaron / bytebot

Posts randomly generated bytebeats with video output to twitter every few hours.
https://twitter.com/bytebeat_bot
3 stars 0 forks source link

Left and right shift operators cause panic due to overflow. #15

Closed a2aaron closed 6 years ago

a2aaron commented 6 years ago

Bytebeat inputs such as t -1 << or t -1 >> cause rust to panic with thread 'main' panicked at 'attempt to shift left with overflow', src/lib.rs:113 or similar. This is due to the fact that t << -1 is always illegal in Rust. To fix, we should probably make sure that the shift amount is always positive.

porglezomp commented 6 years ago

Specifically, shifting by an amount not in 0..64 is illegal for an i64