Chromium Code Reviews| Index: base/pickle.cc |
| diff --git a/base/pickle.cc b/base/pickle.cc |
| index a9e9a0fdfbcb623c721082d9273fc2e10b2dd259..c679c35a304eafefc2052692ba98193518df80a9 100644 |
| --- a/base/pickle.cc |
| +++ b/base/pickle.cc |
| @@ -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 float reads |
|
acolwell GONE FROM CHROMIUM
2014/07/14 19:25:42
nit: s/float/double/ ?
Mostyn Bramley-Moore
2014/07/14 19:48:03
Done.
|
| + // 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)) |