Commit e6573624 authored by Sven Sauleau's avatar Sven Sauleau Committed by Commit Bot

[wasm] fix js-api global/value-get-set

Fix WebAssembly's global/value-get-set. The argument must not be
undefined.

mjsunit tests were updated.

Bug: v8:8319
Change-Id: Id3d3c9b18cbc8854e589481dfc7c52f35cfb7bf7
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Reviewed-on: https://chromium-review.googlesource.com/c/1411886Reviewed-by: 's avatarBen Smith <binji@chromium.org>
Commit-Queue: Sven Sauleau <ssauleau@igalia.com>
Cr-Commit-Position: refs/heads/master@{#58863}
parent 4064757c
......@@ -1517,6 +1517,10 @@ void WebAssemblyGlobalSetValue(
thrower.TypeError("Can't set the value of an immutable global.");
return;
}
if (args[0]->IsUndefined()) {
thrower.TypeError("Argument 0: must be a value");
return;
}
switch (receiver->type()) {
case i::wasm::kWasmI32: {
......
......@@ -164,7 +164,7 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
}
TestGlobal(null);
TestGlobal(undefined);
assertThrows(() => TestGlobal(undefined), TypeError);
TestGlobal(1663);
TestGlobal("testmyglobal");
TestGlobal({a: 11});
......
......@@ -9,7 +9,6 @@
'table/grow': [FAIL],
'table/get-set': [FAIL],
'module/customSections': [FAIL],
'global/value-get-set': [FAIL],
}], # ALWAYS
[ALWAYS, {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment