mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Fixed uninitialized variable in Array<>
This commit is contained in:
parent
eead3f55ec
commit
b25efbb996
@ -277,7 +277,7 @@ class Array : public ArrayImpl<T, ArrayMode, MaxSize_>
|
||||
for (SizeType i = 0; i < size(); i++)
|
||||
{
|
||||
const bool last_item = i == (size() - 1);
|
||||
ValueType value; // TODO: avoid extra copy
|
||||
ValueType value = ValueType(); // TODO: avoid extra copy
|
||||
const int res = RawValueType::decode(value, codec, last_item ? tao_mode : TailArrayOptDisabled);
|
||||
if (res <= 0)
|
||||
{
|
||||
@ -296,7 +296,7 @@ class Array : public ArrayImpl<T, ArrayMode, MaxSize_>
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
ValueType value;
|
||||
ValueType value = ValueType();
|
||||
const int res = RawValueType::decode(value, codec, TailArrayOptDisabled);
|
||||
if (res < 0)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user