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>
Crashpad is a crash-reporting system.
Crashpad’s source code is hosted in a Git repository at https://chromium.googlesource.com/crashpad/crashpad.