Fix MemorySnapshotSanitized for 32-bit builds, where size_t ≠ VMAddress

By explicitly requesting the desired specialization of std::min, this
fixes a compile-time error encountered with 526fd4a0352b at
https://ci.chromium.org/ui/p/chromium/builders/try/android-binary-size/2851684/
→ 33. compile → stdout:

../../third_party/crashpad/crashpad/snapshot/sanitized/memory_snapshot_sanitized.cc:60:35: error: no matching function for call to 'min'
   60 |     const size_t aligned_offset = std::min(
      |                                   ^~~~~~~~
../../third_party/libc++/src/include/__algorithm/min.h:35:1: note: candidate template ignored: deduced conflicting types for parameter '_Tp' ('size_t' (aka 'unsigned int') vs. 'VMAddress' (aka 'unsigned long long'))
   35 | min(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b) {
      | ^
../../third_party/libc++/src/include/__algorithm/min.h:43:1: note: candidate template ignored: could not match 'initializer_list<_Tp>' against 'size_t' (aka 'unsigned int')
   43 | min(initializer_list<_Tp> __t, _Compare __comp) {
      | ^
../../third_party/libc++/src/include/__algorithm/min.h:48:82: note: candidate function template not viable: requires single argument '__t', but 2 arguments were provided
   48 | [[__nodiscard__]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp min(initializer_list<_Tp> __t) {
      |                                                                                  ^   ~~~~~~~~~~~~~~~~~~~~~~~~~
../../third_party/libc++/src/include/__algorithm/min.h:29:1: note: candidate function template not viable: requires 3 arguments, but 2 were provided
   29 | min(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Compare __comp) {
      | ^                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Bug: 500097298
Change-Id: I782169d71c020cd52c5d4a7c1312364487e44904
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/8164800
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
1 file changed
tree: d7a973de875f1657a2e7e8c6922fb29c3a705e1d
  1. build/
  2. client/
  3. compat/
  4. doc/
  5. handler/
  6. infra/
  7. minidump/
  8. snapshot/
  9. test/
  10. third_party/
  11. tools/
  12. util/
  13. .clang-format
  14. .gitattributes
  15. .gitignore
  16. .gn
  17. .style.yapf
  18. .vpython3
  19. AUTHORS
  20. BUILD.gn
  21. codereview.settings
  22. CONTRIBUTORS
  23. DEPS
  24. LICENSE
  25. navbar.md
  26. OWNERS
  27. package.h
  28. README.md
README.md

Crashpad

Crashpad is a crash-reporting system.

Documentation

Source Code

Crashpad’s source code is hosted in a Git repository at https://chromium.googlesource.com/crashpad/crashpad.

Other Links