Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(618)

Unified Diff: src/objects.cc

Issue 1925803005: [runtime] Don't crash when creating an instance of a class inherited from a Proxy. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-v8-4972.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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())) {
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-v8-4972.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698