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

Unified Diff: src/snapshot/deserializer.cc

Issue 2738213002: [serializer] check that deserializer read the entire blob. (Closed)
Patch Set: 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..feb0078e6729f6eeaf9160c01ffc624e47dc9e31 100644
--- a/src/snapshot/deserializer.cc
+++ b/src/snapshot/deserializer.cc
@@ -172,9 +172,13 @@ 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;
+ while (source_.HasMore()) {
+ byte next = source_.Get();
+ CHECK_EQ(kNop, next);
vogelheim 2017/03/09 12:21:27 For my understanding: This loop is meant to compen
Yang 2017/03/09 12:22:24 Yes.
+ }
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