summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/regress/regress-crbug-772056.js
blob: d9fb4d51d2efcfc9fa63c9b050e0090d1d7c727a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Flags: --expose-wasm

load("test/mjsunit/wasm/wasm-module-builder.js");

var builder = new WasmModuleBuilder();
builder.addImportedTable("x", "table", 1, 10000000);
let module = new WebAssembly.Module(builder.toBuffer());
let table = new WebAssembly.Table({element: "anyfunc",
  initial: 1, maximum:1000000});
let instance = new WebAssembly.Instance(module, {x: {table:table}});

assertThrows(() => table.grow(Infinity), TypeError);