v8/test/mjsunit/regress/wasm/regression-5531.js
ahaas 2f3ca961c7 [turbofan] Use uint32 to store the number of control outputs instead of uint16.
Using uint32 to store the the number of control outputs allows WebAssembly switches to have more than 2^16 case.

BUG=v8:5531
TEST=mjsunit/regress/wasm/regression-5531
R=titzer@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2425983002
Cr-Commit-Position: refs/heads/master@{#40420}
2016-10-19 07:25:51 +00:00

23 lines
706 B
JavaScript

// Copyright 2016 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-constants.js");
load("test/mjsunit/wasm/wasm-module-builder.js");
(function() {
var builder = new WasmModuleBuilder();
builder.addMemory(1, 1, false);
builder.addFunction("foo", kSig_i_v)
.addBody([
kExprI32Const, 0x00,
kExprI8Const, 0xcb,
kExprI8Const, 0xff,
kExprBrTable, 0xcb, 0xcb, 0xcb, 0x00, 0x00, 0xcb, 0x00 // entries=1238475
])
.exportFunc();
assertThrows(function() { builder.instantiate(); });
})();