forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs: v8/v8@6.3.292.46...6.3.292.48 PR-URL: nodejs#17773 Reviewed-By: Michaël Zasso <[email protected]>
- Loading branch information
1 parent
1a396bb
commit b5d4153
Showing
4 changed files
with
40 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// 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 | ||
|
||
function f() { | ||
function g(arg) { return arg; } | ||
// The closure contains a call IC slot. | ||
return function() { return g(42); }; | ||
} | ||
|
||
const a = Realm.create(); | ||
const b = Realm.create(); | ||
|
||
// Create two closures in different contexts sharing the same | ||
// SharedFunctionInfo (shared due to code caching). | ||
const x = Realm.eval(a, f.toString() + " f()"); | ||
const y = Realm.eval(b, f.toString() + " f()"); | ||
|
||
// Run the first closure to create SFI::code. | ||
x(); | ||
|
||
// At this point, SFI::code is set and `x` has a feedback vector (`y` does not). | ||
|
||
// Enabling block code coverage deoptimizes all functions and triggers the | ||
// buggy code path in which we'd unconditionally replace JSFunction::code with | ||
// its SFI::code (but skip feedback vector setup). | ||
%DebugToggleBlockCoverage(true); | ||
|
||
// Still no feedback vector set on `y` but it now contains code. Run it to | ||
// trigger the crash when attempting to write into the non-existent feedback | ||
// vector. | ||
y(); |