Skip to content

Commit 70424a2

Browse files
author
git apple-llvm automerger
committed
Merge commit '29770a59a375' from swift/release/6.1 into stable/20240723
2 parents 5675313 + 29770a5 commit 70424a2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lldb/source/Symbol/CompilerType.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1158,8 +1158,11 @@ bool CompilerType::GetValueAsScalar(const lldb_private::DataExtractor &data,
11581158
return false;
11591159

11601160
std::optional<uint64_t> byte_size = GetByteSize(exe_scope);
1161-
if (!byte_size)
1161+
// A bit or byte size of 0 is not a bug, but it doesn't make sense to read a
1162+
// scalar of zero size.
1163+
if (!byte_size || *byte_size == 0)
11621164
return false;
1165+
11631166
lldb::offset_t offset = data_byte_offset;
11641167
switch (encoding) {
11651168
case lldb::eEncodingInvalid:

0 commit comments

Comments
 (0)