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

Unified Diff: src/snapshot/deserializer.cc

Issue 2738213002: [serializer] check that deserializer read the entire blob. (Closed)
Patch Set: add comment Created 3 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/deserializer.cc
diff --git a/src/snapshot/deserializer.cc b/src/snapshot/deserializer.cc
index a670bf796e3deeb08531a9a7d918b1d1642de18c..68e2716e6ff78e902358e8991a999f3939b39cd4 100644
--- a/src/snapshot/deserializer.cc
+++ b/src/snapshot/deserializer.cc
@@ -172,9 +172,11 @@ MaybeHandle<HeapObject> Deserializer::DeserializeObject(Isolate* isolate) {
}
Deserializer::~Deserializer() {
- // TODO(svenpanne) Re-enable this assertion when v8 initialization is fixed.
- // DCHECK(source_.AtEOF());
#ifdef DEBUG
+ // Do not perform checks if we aborted deserialization.
+ if (source_.position() == 0) return;
+ // Check that we only have padding bytes remaining.
+ while (source_.HasMore()) CHECK_EQ(kNop, source_.Get());
for (int space = 0; space < kNumberOfPreallocatedSpaces; space++) {
int chunk_index = current_chunk_[space];
CHECK_EQ(reservations_[space].length(), chunk_index + 1);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698