mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWasm: Improve element validation and instantiation
This commit is contained in:
parent
4c3071c7c2
commit
3225e6fad2
Notes:
sideshowbarker
2024-07-17 07:19:27 +09:00
Author: https://github.com/dzfrias
Commit: 3225e6fad2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/181
Reviewed-by: https://github.com/alimpfard
3 changed files with 13 additions and 7 deletions
|
@ -1281,10 +1281,10 @@ ParseResult<ElementSection::Element> ElementSection::Element::parse(Stream& stre
|
|||
Vector<Expression> items;
|
||||
if (!has_exprs) {
|
||||
auto indices = TRY(parse_vector<GenericIndexParser<FunctionIndex>>(stream));
|
||||
Vector<Instruction> instructions;
|
||||
for (auto& index : indices)
|
||||
instructions.empend(Instructions::ref_func, index);
|
||||
items = { Expression { move(instructions) } };
|
||||
for (auto& index : indices) {
|
||||
Vector<Instruction> instructions { Instruction(Instructions::ref_func, index) };
|
||||
items.empend(move(instructions));
|
||||
}
|
||||
} else {
|
||||
items = TRY(parse_vector<Expression>(stream));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue