From 4417b428061276a88c41825f2e46e2dce387dd0a Mon Sep 17 00:00:00 2001 From: Eric Kunze Date: Mon, 20 Jun 2022 07:27:42 -0700 Subject: Fix bug in bool to u8 conversion Can't assume that the boolean is represented as 8-bits. Signed-off-by: Eric Kunze Change-Id: Ic7bbf6dc92f243f9c4cf0bb606dde127ba8684e3 --- src/tosa_serialization_handler.cpp | 4 ++-- 1 file 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& in out.clear(); for (auto val : in) { - uint8_t* val_u8 = reinterpret_cast(&val); - out.push_back(*val_u8); + uint8_t val_u8 = val; + out.push_back(val_u8); } zero_pad(out); return TOSA_OK; -- cgit v1.2.1