Index: src/elements.cc |
diff --git a/src/elements.cc b/src/elements.cc |
index e6d3f84f9ce8eec80bec76695220f6ff392c2787..4e8f7b2741ffa7cdd2df3cde075805f35ef0e3fa 100644 |
--- a/src/elements.cc |
+++ b/src/elements.cc |
@@ -705,7 +705,10 @@ class ElementsAccessorBase : public ElementsAccessor { |
array->initialize_elements(); |
} else if (length <= capacity) { |
if (array->HasFastSmiOrObjectElements()) { |
- backing_store = JSObject::EnsureWritableFastElements(array); |
+ JSObject::EnsureWritableFastElements(array); |
+ if (array->elements() != *backing_store) { |
+ backing_store = handle(array->elements(), isolate); |
+ } |
} |
if (2 * length <= capacity) { |
// If more than half the elements won't be used, trim the array. |