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); |
} |