diff --git a/src/web-snapshot/web-snapshot.cc b/src/web-snapshot/web-snapshot.cc index c81adbbf04..11af9ae812 100644 --- a/src/web-snapshot/web-snapshot.cc +++ b/src/web-snapshot/web-snapshot.cc @@ -1762,8 +1762,9 @@ void WebSnapshotDeserializer::DeserializeExports() { Handle dictionary( global->global_dictionary(isolate_, kAcquireLoad), isolate_); - dictionary = GlobalDictionary::EnsureCapacity(isolate_, dictionary, count, - AllocationType::kYoung); + dictionary = GlobalDictionary::EnsureCapacity( + isolate_, dictionary, dictionary->NumberOfElements() + count, + AllocationType::kYoung); global->set_global_dictionary(*dictionary, kReleaseStore); for (uint32_t i = 0; i < count; ++i) {