Reviewers: Hannes Payer,

Description:
Fix bogus assertion.

[email protected]
BUG=347530

Please review this at https://codereview.chromium.org/183243002/

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

Affected files (+3, -2 lines):
  M src/objects.cc


Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 59a5967395fbc9a4fc820dcf7f260444cb1830cb..1d7c6726e68199946c951c41d723ebb4121ae8ef 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -13089,8 +13089,9 @@ void JSObject::GetElementsCapacityAndUsage(int* capacity, int* used) {
       }
       // Fall through if packing is not guaranteed.
     case FAST_HOLEY_DOUBLE_ELEMENTS: {
-      FixedDoubleArray* elms = FixedDoubleArray::cast(elements());
-      *capacity = elms->length();
+      *capacity = elements()->length();
+      if (*capacity == 0) break;
+      FixedDoubleArray * elms = FixedDoubleArray::cast(elements());
       for (int i = 0; i < *capacity; i++) {
         if (!elms->is_the_hole(i)) ++(*used);
       }


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to