diff options
| author | 2022-06-07 18:05:32 -0400 | |
|---|---|---|
| committer | 2022-06-13 20:09:00 -0400 | |
| commit | 58fea44eb5bfe268c1ddd2ea063744eb7bbe7e44 (patch) | |
| tree | 52b3e426fa061171cab80a7b61ab6e52aa163966 /src/common/assert.cpp | |
| parent | common: Change semantics of UNREACHABLE to unconditionally crash (diff) | |
| download | yuzu-58fea44eb5bfe268c1ddd2ea063744eb7bbe7e44.tar.gz yuzu-58fea44eb5bfe268c1ddd2ea063744eb7bbe7e44.tar.xz yuzu-58fea44eb5bfe268c1ddd2ea063744eb7bbe7e44.zip | |
common: Don't test ASSERT conditions inline
Diffstat (limited to 'src/common/assert.cpp')
| -rw-r--r-- | src/common/assert.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/common/assert.cpp b/src/common/assert.cpp index a27a025ae..b20c19123 100644 --- a/src/common/assert.cpp +++ b/src/common/assert.cpp | |||
| @@ -6,9 +6,13 @@ | |||
| 6 | 6 | ||
| 7 | #include "common/settings.h" | 7 | #include "common/settings.h" |
| 8 | 8 | ||
| 9 | void assert_handle_failure() { | 9 | void assert_check_condition(bool cond, std::function<void()>&& on_failure) { |
| 10 | if (Settings::values.use_debug_asserts) { | 10 | if (!cond) { |
| 11 | Crash(); | 11 | on_failure(); |
| 12 | |||
| 13 | if (Settings::values.use_debug_asserts) { | ||
| 14 | Crash(); | ||
| 15 | } | ||
| 12 | } | 16 | } |
| 13 | } | 17 | } |
| 14 | 18 | ||