mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 08:11:13 +00:00
LibWeb/WebAssembly: Throw when a table type's max > initial
This commit is contained in:
parent
80434fa516
commit
0aa76b5f67
Notes:
github-actions[bot]
2024-08-18 21:35:59 +00:00
Author: https://github.com/dzfrias Commit: https://github.com/LadybirdBrowser/ladybird/commit/0aa76b5f672 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1105 Reviewed-by: https://github.com/alimpfard
|
@ -38,6 +38,9 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Table>> Table::construct_impl(JS::Realm& re
|
|||
? Detail::default_webassembly_value(vm, reference_type)
|
||||
: TRY(Detail::to_webassembly_value(vm, value, reference_type));
|
||||
|
||||
if (descriptor.maximum.has_value() && descriptor.maximum.value() < descriptor.initial)
|
||||
return vm.throw_completion<JS::RangeError>("Maximum should not be less than initial in table type"sv);
|
||||
|
||||
Wasm::Limits limits { descriptor.initial, move(descriptor.maximum) };
|
||||
Wasm::TableType table_type { reference_type, move(limits) };
|
||||
|
||||
|
|
Loading…
Reference in a new issue