mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-21 18:15:58 +00:00
AK: Make InputMemoryStream::read_LEB128_*
templated
On i686, reading integers larger than `2^32 - 1` would fail as the 32-bit `size_t` parameter would overflow. This caused us to read too few bytes in LibDebug's DWARF parser. Making this method templated solves this issue, as we now can call this API with a `u64` parameter.
This commit is contained in:
parent
a59b9357e3
commit
efd1aea969
|
@ -74,9 +74,11 @@ public:
|
|||
return m_bytes[m_offset];
|
||||
}
|
||||
|
||||
bool read_LEB128_unsigned(size_t& result) { return LEB128::read_unsigned(*this, result); }
|
||||
template<typename ValueType>
|
||||
bool read_LEB128_unsigned(ValueType& result) { return LEB128::read_unsigned(*this, result); }
|
||||
|
||||
bool read_LEB128_signed(ssize_t& result) { return LEB128::read_signed(*this, result); }
|
||||
template<typename ValueType>
|
||||
bool read_LEB128_signed(ValueType& result) { return LEB128::read_signed(*this, result); }
|
||||
|
||||
ReadonlyBytes bytes() const { return m_bytes; }
|
||||
size_t offset() const { return m_offset; }
|
||||
|
|
Loading…
Reference in a new issue