Commit 9a3b2a76 authored by Enrico Bacis's avatar Enrico Bacis Committed by Commit Bot

[wasm] Add test for growing exported memory past maximum

The test TestExportImportedMemoryGrowMultipleInstances in
test/mjsunit/wasm/import-memory.js had a TODO about not taking into
account the maximum size for exported memory objects, thus permitting to
grow past thhe maximum specified in the exported memory object.

The check is already in place at wasm-objects.cc:266
(https://cs.chromium.org/chromium/src/v8/src/wasm/wasm-objects.cc?rcl=a01b55b548add5aec1d3d4d8fcdadfa01555c6ea&l=266).

This CL removes the TODO and asserts that growing past maximum for
exported objects fails.

R=ahaas@chromium.org, gdeepti@chromium.org

Change-Id: Ifa69e4e85e04bc2280b629cebb30d400cca9420f
Reviewed-on: https://chromium-review.googlesource.com/593948Reviewed-by: 's avatarDeepti Gandluri <gdeepti@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Enrico Bacis <enricobacis@google.com>
Cr-Commit-Position: refs/heads/master@{#47029}
parent 316254a7
......@@ -326,9 +326,6 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
})();
(function TestExportImportedMemoryGrowMultipleInstances() {
// TODO(gdeepti):Exported memory objects currently do not take max_size
// into account so this can grow past the maximum specified in the exported
// memory object. Assert that growing past maximum for exported objects fails.
print("TestExportImportedMemoryGrowMultipleInstances");
var instance;
{
......@@ -364,6 +361,10 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
assertEquals(current_mem_size, instances[i].exports.grow(1));
verify_mem_size(++current_mem_size);
}
for (var i = 0; i < 10; i++) {
assertEquals(-1, instances[i].exports.grow(1));
verify_mem_size(current_mem_size);
}
})();
(function TestExportGrow() {
......
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