Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Version 5.0.71.44 (cherry-pick)
Browse files Browse the repository at this point in the history
Merged b83edcc

[runtime] Don't crash when creating an instance of a class inherited from a Proxy.

BUG=v8:4972
LOG=N
[email protected]

Review URL: https://codereview.chromium.org/1936983002 .

Cr-Commit-Position: refs/branch-heads/5.0@{#53}
Cr-Branched-From: ad16e6c-refs/heads/5.0.71@{#1}
Cr-Branched-From: bd9df50-refs/heads/master@{#34215}
  • Loading branch information
isheludko committed May 2, 2016
1 parent 928294f commit 5f4327c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 5
#define V8_MINOR_VERSION 0
#define V8_BUILD_NUMBER 71
#define V8_PATCH_LEVEL 43
#define V8_PATCH_LEVEL 44

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
4 changes: 3 additions & 1 deletion src/objects.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13715,7 +13715,9 @@ void JSFunction::CalculateInstanceSizeForDerivedClass(
for (PrototypeIterator iter(isolate, this,
PrototypeIterator::START_AT_RECEIVER);
!iter.IsAtEnd(); iter.Advance()) {
JSFunction* func = iter.GetCurrent<JSFunction>();
JSReceiver* current = iter.GetCurrent<JSReceiver>();
if (!current->IsJSFunction()) break;
JSFunction* func = JSFunction::cast(current);
SharedFunctionInfo* shared = func->shared();
expected_nof_properties += shared->expected_nof_properties();
if (!IsSubclassConstructor(shared->kind())) {
Expand Down
5 changes: 5 additions & 0 deletions test/mjsunit/regress/regress-v8-4972.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// 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.

new class extends new Proxy(class {},{}) {}

0 comments on commit 5f4327c

Please sign in to comment.