mach: Restructure exception server to separate protected exception cases

In contrast to to the modern mach_exc, the original 32-bit exc does not
support identity-protected exceptions (e.g.,
EXCEPTION_IDENTITY_PROTECTED). Under the previous unified switch
statement design, the protected cases in ExcServer<Traits>::
MachMessageServerFunction were compiled (but dead) when Traits =
ExcTraits. This forced the use of raw pointer type casts to compile
mismatched exception code arrays (casting 64-bit exception codes to
32-bit exception codes), which was flagged during spanification and by
UBSan.

This change restructures the MachMessageServerFunction by splitting it
into two distinct switch statements:
- A switch statement for standard exceptions compiled for all Traits.
- A switch statement for identity-protected exceptions nested inside
  a single `if constexpr (std::is_same_v<Traits, MachExcTraits>)` block.

This ensures protected exception cases are only compiled and
instantiated when Traits = MachExcTraits.

Bug: 401232341
Change-Id: I1d4ae2d46d91d87aa67d5a5a5e445d1f9e2dc067
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/7880932
Commit-Queue: Justin Cohen <justincohen@google.com>
Reviewed-by: Mark Mentovai <mark@chromium.org>
1 file changed
tree: dbf667ec7163b0f5db225a36cf0a1c6fa85ff1f5
  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