mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-01-15 11:25:13 +00:00
411449cd51
Some checks are pending
Reuse / reuse (push) Waiting to run
Clang Format / clang-format (push) Waiting to run
Linux-Qt / build (push) Waiting to run
Linux / build (push) Waiting to run
macOS-Qt / build (push) Waiting to run
macOS / build (push) Waiting to run
Windows-Qt / build (push) Waiting to run
Windows / build (push) Waiting to run
33 lines
800 B
C++
33 lines
800 B
C++
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#include "common/arch.h"
|
|
#include "common/assert.h"
|
|
#include "common/logging/backend.h"
|
|
|
|
#if defined(ARCH_X86_64)
|
|
#define Crash() __asm__ __volatile__("int $3")
|
|
#elif defined(ARCH_ARM64)
|
|
#define Crash() __asm__ __volatile__("brk 0")
|
|
#else
|
|
#error "Missing Crash() implementation for target CPU architecture."
|
|
#endif
|
|
|
|
void assert_fail_impl() {
|
|
Common::Log::Stop();
|
|
std::fflush(stdout);
|
|
Crash();
|
|
}
|
|
|
|
[[noreturn]] void unreachable_impl() {
|
|
Common::Log::Stop();
|
|
std::fflush(stdout);
|
|
Crash();
|
|
throw std::runtime_error("Unreachable code");
|
|
}
|
|
|
|
void assert_fail_debug_msg(const char* msg) {
|
|
LOG_CRITICAL(Debug, "Assertion Failed!\n{}", msg);
|
|
assert_fail_impl();
|
|
}
|