LibWasm: Read indices as LEB128 u32s

Every type of index was previously being read as a size_t.
This commit is contained in:
Diego 2024-06-16 07:38:06 -07:00 committed by Ali Mohammad Pur
parent 78c56d80f9
commit 20d8ea4db1
Notes: sideshowbarker 2024-07-16 22:17:03 +09:00

View file

@ -82,7 +82,7 @@ template<typename T>
struct GenericIndexParser {
static ParseResult<T> parse(Stream& stream)
{
auto value_or_error = stream.read_value<LEB128<size_t>>();
auto value_or_error = stream.read_value<LEB128<u32>>();
if (value_or_error.is_error())
return with_eof_check(stream, ParseError::ExpectedIndex);
size_t value = value_or_error.release_value();