HomeKitADK icon indicating copy to clipboard operation
HomeKitADK copied to clipboard

TLVReader int parsing fixes

Open markirb opened this issue 2 years ago • 1 comments

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.

markirb avatar Jul 06 '22 19:07 markirb

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...

markirb avatar Jul 29 '22 13:07 markirb