Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Unified Diff: src/objects.cc

Issue 1125073004: Prevent stack overflow in the serializer/deserializer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixed all Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/bootstrapper.cc ('k') | src/snapshot/serialize.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 1224ab1c6d73c244e089564746ac8abf22d08801..6dc5de2552847c8487da20604452705a7837143f 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -14689,11 +14689,12 @@ Handle<Derived> HashTable<Derived, Shape, Key>::New(
PretenureFlag pretenure) {
DCHECK(0 <= at_least_space_for);
DCHECK(!capacity_option || base::bits::IsPowerOfTwo32(at_least_space_for));
- int capacity = (capacity_option == USE_CUSTOM_MINIMUM_CAPACITY)
- ? at_least_space_for
- : isolate->serializer_enabled()
- ? ComputeCapacityForSerialization(at_least_space_for)
- : ComputeCapacity(at_least_space_for);
+ int capacity =
+ (capacity_option == USE_CUSTOM_MINIMUM_CAPACITY)
+ ? at_least_space_for
+ : isolate->serializer_enabled() && isolate->bootstrapper()->IsActive()
+ ? ComputeCapacityForSerialization(at_least_space_for)
+ : ComputeCapacity(at_least_space_for);
if (capacity > HashTable::kMaxCapacity) {
v8::internal::Heap::FatalProcessOutOfMemory("invalid table size", true);
}
« no previous file with comments | « src/bootstrapper.cc ('k') | src/snapshot/serialize.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698