mirror of https://github.com/bsnes-emu/bsnes.git
55e05c89c2
Natural/Integer<T>.bit() (BitRange) was shifting by whatever type the source was to match the target bit length. But this breaks when the target type is u64/s64 and the source type is u32/s32 or smaller. Shifting by >=32 becomes undefined behavior. We have to cast the input source to the target type first, so that the source<<shift result is valid. This is safe here regardless of source's signedness, because it's only used in =, &=, ^=, |= operations. |
||
---|---|---|
.. | ||
bit-field.hpp | ||
bit-range.hpp | ||
boolean.hpp | ||
integer.hpp | ||
literals.hpp | ||
natural.hpp | ||
real.hpp | ||
types.hpp |