Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / base / pickle.cc
index a9e9a0f..2d7a051 100644 (file)
@@ -118,6 +118,18 @@ bool PickleIterator::ReadFloat(float* result) {
   return true;
 }
 
+bool PickleIterator::ReadDouble(double* result) {
+  // crbug.com/315213
+  // The source data may not be properly aligned, and unaligned double reads
+  // cause SIGBUS on some ARM platforms, so force using memcpy to copy the data
+  // into the result.
+  const char* read_from = GetReadPointerAndAdvance<double>();
+  if (!read_from)
+    return false;
+  memcpy(result, read_from, sizeof(*result));
+  return true;
+}
+
 bool PickleIterator::ReadString(std::string* result) {
   int len;
   if (!ReadInt(&len))