From 3eb3f8cb6523660f78dd4bd5e34cd59da22437d5 Mon Sep 17 00:00:00 2001 From: "erik.corry@gmail.com" Date: Mon, 24 Oct 2011 12:39:29 +0000 Subject: [PATCH] Fix crash in partial snapshot test when running with no boot snapshot. Review URL: http://codereview.chromium.org/8381003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9755 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/serialize.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/serialize.cc b/src/serialize.cc index a48e119..dad2c2b 100644 --- a/src/serialize.cc +++ b/src/serialize.cc @@ -757,7 +757,7 @@ static const int kUnknownOffsetFromStart = -1; void Deserializer::ReadChunk(Object** current, Object** limit, int source_space, - Address address) { + Address current_object_address) { Isolate* const isolate = isolate_; while (current < limit) { int data = source_->Get(); @@ -845,9 +845,11 @@ void Deserializer::ReadChunk(Object** current, *current = new_object; \ } \ } \ - if (emit_write_barrier) { \ - isolate->heap()->RecordWrite(address, static_cast( \ - reinterpret_cast
(current) - address)); \ + if (emit_write_barrier && current_object_address != NULL) { \ + Address current_address = reinterpret_cast
(current); \ + isolate->heap()->RecordWrite( \ + current_object_address, \ + static_cast(current_address - current_object_address)); \ } \ if (!current_was_incremented) { \ current++; /* Increment current if it wasn't done above. */ \ -- 2.7.4