mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
LibWasm: Fix memarg multi-memory reading
The extension bit for the memory index present in memargs is at position 6, but we previously checked position 5, which caused a few spec issues.
This commit is contained in:
parent
c76140f6ed
commit
50dc1c3c19
Notes:
sideshowbarker
2024-07-17 01:27:18 +09:00
Author: https://github.com/dzfrias Commit: https://github.com/LadybirdBrowser/ladybird/commit/50dc1c3c19
1 changed files with 2 additions and 2 deletions
|
@ -388,8 +388,8 @@ ParseResult<Vector<Instruction>> Instruction::parse(Stream& stream, InstructionP
|
|||
|
||||
// Proposal "multi-memory", if bit 6 of alignment is set, then a memory index follows the alignment.
|
||||
size_t memory_index = 0;
|
||||
if ((align & 0x20) != 0) {
|
||||
align &= ~0x20;
|
||||
if ((align & 0x40) != 0) {
|
||||
align &= ~0x40;
|
||||
auto memory_index_or_error = stream.read_value<LEB128<u32>>();
|
||||
if (memory_index_or_error.is_error())
|
||||
return with_eof_check(stream, ParseError::InvalidInput);
|
||||
|
|
Loading…
Add table
Reference in a new issue