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

Commit

Permalink
[runtime] Don't crash when creating an instance of a class inherited …
Browse files Browse the repository at this point in the history
…from a Proxy.

BUG=v8:4972
LOG=N

Review-Url: https://codereview.chromium.org/1925803005
Cr-Commit-Position: refs/heads/master@{#35911}
  • Loading branch information
isheludko authored and Commit bot committed Apr 29, 2016
1 parent 45f52fc commit b83edcc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/objects.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13164,7 +13164,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 b83edcc

Please sign in to comment.