Reviewers: Yang,

Description:
Fix test failures on nosnap builder.

Please review this at https://chromiumcodereview.appspot.com/10915277/

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/serialize.cc
  M     src/snapshot-common.cc


Index: src/serialize.cc
===================================================================
--- src/serialize.cc    (revision 12511)
+++ src/serialize.cc    (working copy)
@@ -1618,7 +1618,7 @@


 bool SnapshotByteSource::AtEOF() {
-  if (0u + length_ - position_ > sizeof(uint32_t)) return false;
+  if (0u + length_ - position_ > 2 * sizeof(uint32_t)) return false;
   for (int x = position_; x < length_; x++) {
     if (data_[x] != SerializerDeserializer::nop()) return false;
   }
Index: src/snapshot-common.cc
===================================================================
--- src/snapshot-common.cc      (revision 12511)
+++ src/snapshot-common.cc      (working copy)
@@ -86,10 +86,13 @@
     int len;
     byte* str = ReadBytes(snapshot_file, &len);
     if (!str) return false;
-    SnapshotByteSource source(str, len);
-    Deserializer deserializer(&source);
-    ReserveSpaceForSnapshot(&deserializer, snapshot_file);
-    bool success = V8::Initialize(&deserializer);
+    bool success;
+    {
+      SnapshotByteSource source(str, len);
+      Deserializer deserializer(&source);
+      ReserveSpaceForSnapshot(&deserializer, snapshot_file);
+      success = V8::Initialize(&deserializer);
+    }
     DeleteArray(str);
     return success;
   } else if (size_ > 0) {


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to