diff options
author | Eric Kunze <eric.kunze@arm.com> | 2022-06-20 07:27:42 -0700 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2022-07-11 16:08:23 -0700 |
commit | 4417b428061276a88c41825f2e46e2dce387dd0a (patch) | |
tree | 3b89f002bfde4ffad773d1a3399bc2755d33c7e3 /src/tosa_serialization_handler.cpp | |
parent | 343d6a703c3a270a01102ec468b59ef2967b595e (diff) | |
download | serialization_lib-4417b428061276a88c41825f2e46e2dce387dd0a.tar.gz |
Fix bug in bool to u8 conversion
Can't assume that the boolean is represented as 8-bits.
Signed-off-by: Eric Kunze <eric.kunze@arm.com>
Change-Id: Ic7bbf6dc92f243f9c4cf0bb606dde127ba8684e3
Diffstat (limited to 'src/tosa_serialization_handler.cpp')
-rw-r--r-- | src/tosa_serialization_handler.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tosa_serialization_handler.cpp b/src/tosa_serialization_handler.cpp index 99da2e7..3a0ce43 100644 --- a/src/tosa_serialization_handler.cpp +++ b/src/tosa_serialization_handler.cpp @@ -854,8 +854,8 @@ tosa_err_t TosaSerializationHandler::ConvertBooltoU8(const std::vector<bool>& in out.clear(); for (auto val : in) { - uint8_t* val_u8 = reinterpret_cast<uint8_t*>(&val); - out.push_back(*val_u8); + uint8_t val_u8 = val; + out.push_back(val_u8); } zero_pad(out); return TOSA_OK; |