v8/test/mjsunit/regress/wasm/regress-crbug-1007608.js
Jakob Kummerow ac94b07ade Fix broken test after 421fd392
Tbr: clemensb@chromium.org
No-Tree-Checks: true
No-Try: true
Change-Id: Id4ca5f618d035de13174e54ff4d617b03d839033
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1847364
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64164}
2019-10-08 16:02:02 +00:00

27 lines
794 B
JavaScript

// Copyright 2019 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.
// Bug is in the C-to-Wasm entry, used e.g. by the Wasm interpreter.
// Flags: --wasm-interpret-all
load("test/mjsunit/wasm/wasm-module-builder.js");
let argc = 7;
let builder = new WasmModuleBuilder();
let types = new Array(argc).fill(kWasmI32);
let sig = makeSig(types, []);
let body = [];
for (let i = 0; i < argc; ++i) {
body.push(kExprLocalGet, i);
}
body.push(kExprCallFunction, 0);
builder.addImport('', 'f', sig);
builder.addFunction("main", sig).addBody(body).exportAs('main');
let instance = builder.instantiate({
'': {
'f': function() { throw "don't crash"; }
}
});
assertThrows(instance.exports.main);