4ad3579119
In some (rare) cases, the context depth passed to a dynamic variable lookup can be zero. In these cases, the fast path for the lookup (i.e. load from context or global) can always be taken, as there is no need to search the current context. However, with no slow path checks, the bytecode graph builder had a null environment for the slow path, causing segfaults when this graph was built. This patch adds a null check for the slow path environment, and skips building the slow path if the environment is null. BUG=chromium:652186 Review-Url: https://codereview.chromium.org/2385123002 Cr-Commit-Position: refs/heads/master@{#39949}
12 lines
267 B
JavaScript
12 lines
267 B
JavaScript
// Copyright 2015 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: --always-opt
|
|
|
|
function f() {
|
|
var x = 1;
|
|
return eval("eval('var x = 2'); x;");
|
|
}
|
|
f();
|