diff --git a/lldb/include/lldb/Symbol/SymbolFile.h b/lldb/include/lldb/Symbol/SymbolFile.h index 5d607989f44d..e2f18d81c3e7 100644 --- a/lldb/include/lldb/Symbol/SymbolFile.h +++ b/lldb/include/lldb/Symbol/SymbolFile.h @@ -132,10 +132,10 @@ public: /// The characteristics of an array type. struct ArrayInfo { - int64_t first_index; + int64_t first_index = 0; llvm::SmallVector element_orders; - uint32_t byte_stride; - uint32_t bit_stride; + uint32_t byte_stride = 0; + uint32_t bit_stride = 0; }; /// If \c type_uid points to an array type, return its characteristics. /// To support variable-length array types, this function takes an diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/array_types/TestArrayTypes.py b/lldb/packages/Python/lldbsuite/test/lang/c/array_types/TestArrayTypes.py index a47e6c311d4b..da3a46ac0bca 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/c/array_types/TestArrayTypes.py +++ b/lldb/packages/Python/lldbsuite/test/lang/c/array_types/TestArrayTypes.py @@ -175,6 +175,8 @@ class ArrayTypesTestCase(TestBase): self.DebugSBValue(variable) self.assertTrue(variable.GetNumChildren() == 4, "Variable 'strings' should have 4 children") + byte_size = variable.GetByteSize() + self.assertTrue(byte_size >= 4*4 and byte_size <= 1024) child3 = variable.GetChildAtIndex(3) self.DebugSBValue(child3)