Index: src/snapshot/partial-serializer.cc |
diff --git a/src/snapshot/partial-serializer.cc b/src/snapshot/partial-serializer.cc |
index b46f6755f0badab8e01e85b8b2eba317aeec724e..d192f51d6f676eda03b748055019ec2bd51a4b80 100644 |
--- a/src/snapshot/partial-serializer.cc |
+++ b/src/snapshot/partial-serializer.cc |
@@ -33,6 +33,9 @@ void PartialSerializer::Serialize(Object** o) { |
context->set(Context::NEXT_CONTEXT_LINK, |
isolate_->heap()->undefined_value()); |
DCHECK(!context->global_object()->IsUndefined(context->GetIsolate())); |
+ // Reset math random cache to get fresh random numbers. |
+ context->set_math_random_index(Smi::kZero); |
+ context->set_math_random_cache(isolate_->heap()->undefined_value()); |
} |
} |
VisitPointer(o); |