1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

AK: Port LEB128 to the new AK::Stream

This commit is contained in:
Tim Schumacher 2023-01-29 13:09:25 +01:00 committed by Andrew Kaster
parent 31f59855b4
commit 787f4d639a
10 changed files with 120 additions and 209 deletions

View file

@ -26,8 +26,7 @@ ErrorOr<void> DIE::rehydrate_from(u32 offset, Optional<u32> parent_offset)
auto stream = TRY(FixedMemoryStream::construct(m_compilation_unit.dwarf_info().debug_info_data()));
// Note: We can't just slice away from the input data here, since get_attribute_value will try to recover the original offset using seek().
TRY(stream->seek(m_offset));
Core::Stream::WrapInAKInputStream wrapped_stream { *stream };
LEB128::read_unsigned(wrapped_stream, m_abbreviation_code);
TRY(LEB128::read_unsigned(*stream, m_abbreviation_code));
m_data_offset = TRY(stream->tell());
if (m_abbreviation_code == 0) {