diff options
Diffstat (limited to 'deps/v8/test/mjsunit/regress/wasm/regress-1237024.js')
-rw-r--r-- | deps/v8/test/mjsunit/regress/wasm/regress-1237024.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/regress/wasm/regress-1237024.js b/deps/v8/test/mjsunit/regress/wasm/regress-1237024.js new file mode 100644 index 0000000000..04dd8018bf --- /dev/null +++ b/deps/v8/test/mjsunit/regress/wasm/regress-1237024.js @@ -0,0 +1,26 @@ +// Copyright 2021 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: --experimental-wasm-gc + +d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js'); + +var builder = new WasmModuleBuilder(); + +let array_index = builder.addArray(kWasmS128, true); + +builder.addFunction("main", kSig_i_i) + .addBody([ + kExprLocalGet, 0, + kGCPrefix, kExprRttCanon, array_index, + kGCPrefix, kExprArrayNewDefault, array_index, + kGCPrefix, kExprArrayLen, array_index, + ]) + .exportFunc(); + +var instance = builder.instantiate(); + +assertThrows( + () => instance.exports.main(1 << 26), WebAssembly.RuntimeError, + 'requested new array is too large'); |