Bug 1264053 - MessagePort should support transferable objects in multi-e10s - part 3. r=me, a=sledru
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 17 Aug 2016 09:30:48 +0200
changeset 349901 5aec8a7d79ca1847abded71d6c43c8558d3473bc
parent 349900 cf237b1047044713b1b0db79a3b0af318a2090c3
child 349902 5277c74e20357c8d1233bf6c1d0113de0fe5404f
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme, sledru
bugs1264053
milestone50.0a2
Bug 1264053 - MessagePort should support transferable objects in multi-e10s - part 3. r=me, a=sledru
js/src/vm/StructuredClone.cpp
--- a/js/src/vm/StructuredClone.cpp
+++ b/js/src/vm/StructuredClone.cpp
@@ -452,18 +452,22 @@ DiscardTransferables(uint64_t* buffer, s
     uint64_t* end = buffer + nbytes / sizeof(uint64_t);
     uint64_t* point = buffer;
     if (point == end)
         return; // Empty buffer
 
     uint32_t tag, data;
     SCInput::getPair(point++, &tag, &data);
 
-    if (tag == SCTAG_HEADER)
+    if (tag == SCTAG_HEADER) {
+        if (point == end)
+            return;
+
         SCInput::getPair(point++, &tag, &data);
+    }
 
     if (tag != SCTAG_TRANSFER_MAP_HEADER)
         return;
 
     if (TransferableMapHeader(data) == SCTAG_TM_TRANSFERRED)
         return;
 
     // freeTransfer should not GC