commit | 984749479f569e7fb43d44aadc39dcc5d6090be0 | [log] [tgz] |
---|---|---|
author | Mark Mentovai <mark@chromium.org> | Thu Apr 27 19:08:17 2017 |
committer | Mark Mentovai <mark@chromium.org> | Thu Apr 27 19:42:25 2017 |
tree | c7f99611d373a5b3681063306b7d689cf7011708 | |
parent | ed8e637817b1e2302618509f440528d8af8a485c [diff] |
Introduce FromPointerCast<>(), with defined sign/zero-extension behavior Some of the new Linux/Android tests were failing in 32-bit code where pointers were being casted via reinterpret_cast<>() to LinuxVMAddress, an unsigned 64-bit type. The behavior of such casts is implementation-defined, and in this case, sign-extension was being used to convert the 32-bit pointers to 64 bits, resulting in very large (unsigned) LinuxVMAddress values that could not possibly refer to proper addresses in a 32-bit process’ address space. The offending reinterpret_cast<>() conversions have been replaced with the new FromPointerCast<>(), which is careful to do sign-extension when converting to a signed type, and zero-extension when converting to an unsigned type like LinuxVMAddress. Bug: crashpad:30 Test: crashpad_util_test FromPointerCast*:MemoryMap.*:ProcessMemory.* Change-Id: I6f1408dc63369a8740ecd6015d657e4407a7c271 Reviewed-on: https://chromium-review.googlesource.com/488264 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Crashpad is a crash-reporting system.
Crashpad’s source code is hosted in a Git repository at https://chromium.googlesource.com/crashpad/crashpad.