Skip to content

Commit dd87dff

Browse files
committed
[lldb][NFC] Replace usage of GetLocalBufferSize with GetLocalBuffer
1 parent 7a38023 commit dd87dff

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntimeDynamicTypeResolution.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,20 +2451,19 @@ bool SwiftLanguageRuntime::GetDynamicTypeAndAddress_Value(
24512451
// If we couldn't find a load address, but the value object has a local
24522452
// buffer, use that.
24532453
if (val_address == LLDB_INVALID_ADDRESS && address_type == eAddressTypeHost) {
2454-
// Get the start and size of the local buffer.
2455-
auto start = in_value.GetValue().GetScalar().ULongLong();
2456-
auto local_buffer_size = in_value.GetLocalBufferSize();
2454+
// Check if the dynamic type fits in the value object's buffer.
2455+
auto in_value_buffer = in_value.GetLocalBuffer();
24572456

2458-
// If we can't find the size of the local buffer we can't safely know if the
2457+
// If we can't find the local buffer we can't safely know if the
24592458
// dynamic type fits in it.
2460-
if (local_buffer_size == LLDB_INVALID_ADDRESS)
2459+
if (in_value_buffer.empty())
24612460
return false;
24622461
// If the dynamic type doesn't in the buffer we can't use it either.
2463-
if (local_buffer_size < bound_type.GetByteSize(exe_scope))
2462+
if (in_value_buffer.size() < bound_type.GetByteSize(exe_scope))
24642463
return false;
24652464

24662465
value_type = Value::GetValueTypeFromAddressType(address_type);
2467-
local_buffer = {(uint8_t *)start, local_buffer_size};
2466+
local_buffer = in_value_buffer;
24682467
return true;
24692468
}
24702469
if (*size && (!val_address || val_address == LLDB_INVALID_ADDRESS))

0 commit comments

Comments
 (0)