Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index ea3649198e1e77b8e1adbfdb4c10f2e000329816..13123f19005cdd39de8615e95cf6e11b2366343b 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -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())) { |