Closed MakoEnergy closed 5 years ago
The function EnumBit with 0 as a parameter results in a temporary that holds UINT_MAX (because 0-1 == UINT_MAX) which is then used to as the amount to bitshift a 1 that many times which is Undefined Behavior.for amounts larger than the size of the UInt64, which UINT_MAX probably is.
This function ought to have range checks (or something) to prevent this UB.
EDIT - Could this be detected by a template?
EDIT 2 - I misread that conditional pretty hard.
The introspection system is designed to be a fast and efficient template metaprogramming means of retrieving and assigning values on arbitrary types. This is meant to be the bases of value access for the serialization system.