Skip to content

Commit b83edcc

Browse files
isheludkoCommit bot
authored andcommitted
[runtime] Don't crash when creating an instance of a class inherited from a Proxy.
BUG=v8:4972 LOG=N Review-Url: https://codereview.chromium.org/1925803005 Cr-Commit-Position: refs/heads/master@{#35911}
1 parent 45f52fc commit b83edcc

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/objects.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13164,7 +13164,9 @@ void JSFunction::CalculateInstanceSizeForDerivedClass(
1316413164
for (PrototypeIterator iter(isolate, this,
1316513165
PrototypeIterator::START_AT_RECEIVER);
1316613166
!iter.IsAtEnd(); iter.Advance()) {
13167-
JSFunction* func = iter.GetCurrent<JSFunction>();
13167+
JSReceiver* current = iter.GetCurrent<JSReceiver>();
13168+
if (!current->IsJSFunction()) break;
13169+
JSFunction* func = JSFunction::cast(current);
1316813170
SharedFunctionInfo* shared = func->shared();
1316913171
expected_nof_properties += shared->expected_nof_properties();
1317013172
if (!IsSubclassConstructor(shared->kind())) {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Copyright 2016 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
new class extends new Proxy(class {},{}) {}

0 commit comments

Comments
 (0)