Index: src/snapshot/serialize.cc |
diff --git a/src/snapshot/serialize.cc b/src/snapshot/serialize.cc |
index 35c03cbc283ade7484b065670c56f1f9ee900eeb..a8d0f51b92ff4e93958528e6ef15dfb9c0e0e94b 100644 |
--- a/src/snapshot/serialize.cc |
+++ b/src/snapshot/serialize.cc |
@@ -2639,13 +2639,13 @@ SerializedCodeData::SerializedCodeData(const List<byte>& payload, |
SerializedCodeData::SanityCheckResult SerializedCodeData::SanityCheck( |
Isolate* isolate, String* source) const { |
uint32_t magic_number = GetMagicNumber(); |
+ if (magic_number != ComputeMagicNumber(isolate)) return MAGIC_NUMBER_MISMATCH; |
uint32_t version_hash = GetHeaderValue(kVersionHashOffset); |
uint32_t source_hash = GetHeaderValue(kSourceHashOffset); |
uint32_t cpu_features = GetHeaderValue(kCpuFeaturesOffset); |
uint32_t flags_hash = GetHeaderValue(kFlagHashOffset); |
uint32_t c1 = GetHeaderValue(kChecksum1Offset); |
uint32_t c2 = GetHeaderValue(kChecksum2Offset); |
- if (magic_number != ComputeMagicNumber(isolate)) return MAGIC_NUMBER_MISMATCH; |
if (version_hash != Version::Hash()) return VERSION_MISMATCH; |
if (source_hash != SourceHash(source)) return SOURCE_MISMATCH; |
if (cpu_features != static_cast<uint32_t>(CpuFeatures::SupportedFeatures())) { |