mirror of https://github.com/lukechilds/node.git
Browse Source
Refs: https://github.com/v8/v8/compare/6.1.534.38...6.1.534.42 PR-URL: https://github.com/nodejs/node/pull/15521 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>v9.x-staging
7 changed files with 73 additions and 8 deletions
@ -0,0 +1,18 @@ |
|||||
|
// 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: --allow-natives-syntax
|
||||
|
|
||||
|
const maxLength = 268435440; |
||||
|
const s = 'A'.repeat(maxLength); |
||||
|
|
||||
|
function foo(s) { |
||||
|
let x = s.indexOf("", maxLength); |
||||
|
return x === maxLength; |
||||
|
} |
||||
|
|
||||
|
assertTrue(foo(s)); |
||||
|
assertTrue(foo(s)); |
||||
|
%OptimizeFunctionOnNextCall(foo); |
||||
|
assertTrue(foo(s)); |
@ -0,0 +1,18 @@ |
|||||
|
// 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: --allow-natives-syntax
|
||||
|
|
||||
|
const maxLength = 268435440; |
||||
|
const s = 'A'.repeat(maxLength); |
||||
|
|
||||
|
function foo(s) { |
||||
|
let x = s.lastIndexOf("", maxLength); |
||||
|
return x === maxLength; |
||||
|
} |
||||
|
|
||||
|
assertTrue(foo(s)); |
||||
|
assertTrue(foo(s)); |
||||
|
%OptimizeFunctionOnNextCall(foo); |
||||
|
assertTrue(foo(s)); |
@ -0,0 +1,33 @@ |
|||||
|
// 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
|
||||
|
|
||||
|
'use strict'; |
||||
|
|
||||
|
load("test/mjsunit/wasm/wasm-constants.js"); |
||||
|
load("test/mjsunit/wasm/wasm-module-builder.js"); |
||||
|
|
||||
|
var builder = new WasmModuleBuilder(); |
||||
|
builder.addImportedTable("x", "table", 1, 10000000); |
||||
|
builder.addFunction("main", kSig_i_i) |
||||
|
.addBody([ |
||||
|
kExprI32Const, 0, |
||||
|
kExprGetLocal, 0, |
||||
|
kExprCallIndirect, 0, kTableZero]) |
||||
|
.exportAs("main"); |
||||
|
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}}); |
||||
|
|
||||
|
table.grow(0x40001); |
||||
|
|
||||
|
let instance2 = new WebAssembly.Instance(module, {x: {table:table}}); |
||||
|
|
||||
|
try { |
||||
|
instance2.exports.main(402982); // should be OOB
|
||||
|
} catch (e) { |
||||
|
print("Correctly caught: ", e); |
||||
|
} |
Loading…
Reference in new issue