Reviewers: Mads Ager,

Description:
Merge svn r8602 to the 3.2 branch.

r8602: Fix a potential crash in const declaration.

Declaration of const lookup slots would trigger an assertion if there was a
setter somewhere in the prototype chain, and that setter was shadowed by a
non-readonly data property also in the prototype chain.

[email protected]


Please review this at http://codereview.chromium.org/7335009/

SVN Base: https://v8.googlecode.com/svn/branches/3.2

Affected files:
  M src/objects.cc


Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index a20548c64f9a8e680e48dc75f4a5580c48a938e4..1eef44bedc3d67c39a4eb17bc616222ded1e80e9 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -1813,13 +1813,9 @@ void JSObject::LookupCallbackSetterInPrototypes(String* name,
        pt = pt->GetPrototype()) {
     JSObject::cast(pt)->LocalLookupRealNamedProperty(name, result);
     if (result->IsProperty()) {
-      if (result->IsReadOnly()) {
-        result->NotFound();
-        return;
-      }
-      if (result->type() == CALLBACKS) {
-        return;
-      }
+      if (result->type() == CALLBACKS && !result->IsReadOnly()) return;
+      // Found non-callback or read-only callback, stop looking.
+      break;
     }
   }
   result->NotFound();


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to