Commit 21880a53 authored by yangguo's avatar yangguo Committed by Commit bot

[serializer] check that deserializer read the entire blob.

R=vogelheim@chromium.org
BUG=v8:6072

Review-Url: https://codereview.chromium.org/2738213002
Cr-Commit-Position: refs/heads/master@{#43697}
parent 99bdf971
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment