HomeKitADK
HomeKitADK copied to clipboard
TLVReader int parsing fixes
This fixes strange behavior (in C++) and resulting errors when parsing to:
uint64_t: 255 << 32 has insufficient space int32_t: 255 << 24 also
It leads to uint64_t only being parsed to 32 bit in my case, also int32 being only "int31"s... ASAN pointed out those as errors on the log.
This is defined behavior in C++ standard but it leads to non-wanted results.
need more input on this? I played around further with this, the u/int64 is definitely a bug on all compilers, be it C or C++....
The int32_t: 255 << 24 seems to be a warning of asan, but seems to work anyways...