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

Unified Diff: src/snapshot/code-serializer.cc

Issue 2418483002: [wasm] test deserialization when header is invalid (Closed)
Patch Set: test method to alter header Created 4 years, 2 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/snapshot/code-serializer.h ('k') | src/snapshot/serializer-common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/code-serializer.cc
diff --git a/src/snapshot/code-serializer.cc b/src/snapshot/code-serializer.cc
index 9712d79e19ed27c214112d4476bd9d256ddb3347..e0e0eb61609564d11bd2721ea17f093315cfb597 100644
--- a/src/snapshot/code-serializer.cc
+++ b/src/snapshot/code-serializer.cc
@@ -415,5 +415,14 @@ const SerializedCodeData SerializedCodeData::FromCachedData(
return scd;
}
+void SerializedCodeData::InvalidateVersionForTest(byte* buffer,
Yang 2016/10/13 06:52:59 I'm not really happy with introducing test APIs. C
Mircea Trofin 2016/10/13 16:09:10 The former is more complicated, because the field
+ size_t buffer_size) {
+ DCHECK_GE(buffer_size, static_cast<size_t>(kVersionHashOffset + kInt32Size));
+ uint32_t expected_version_hash = Version::Hash();
+ uint32_t invalid_version_hash = expected_version_hash + 1;
+ SerializedData::SetHeaderValueInBuffer(buffer, kVersionHashOffset,
+ invalid_version_hash);
+}
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/snapshot/code-serializer.h ('k') | src/snapshot/serializer-common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698