From aa4a3e09e44b7b8d96d146d2761c6311c7383ad4 Mon Sep 17 00:00:00 2001 From: Wunkolo Date: Sun, 28 Apr 2024 19:09:28 -0700 Subject: [PATCH] [UI] Fix divide-by-zero hazard This value is currently returning `0` on ARM machines and throws an exception. --- third_party/microprofile/microprofileui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/microprofile/microprofileui.h b/third_party/microprofile/microprofileui.h index d422445dd..8f47a619d 100644 --- a/third_party/microprofile/microprofileui.h +++ b/third_party/microprofile/microprofileui.h @@ -3252,7 +3252,7 @@ void MicroProfileDraw(uint32_t nWidth, uint32_t nHeight) #if MICROPROFILE_CONTEXT_SWITCH_TRACE MicroProfileStringArrayAddLiteral(&Debug, "Context Switch"); - MicroProfileStringArrayFormat(&Debug, "%9d [%7d]", S.nContextSwitchUsage, MICROPROFILE_CONTEXT_SWITCH_BUFFER_SIZE / S.nContextSwitchUsage ); + MicroProfileStringArrayFormat(&Debug, "%9d [%7d]", S.nContextSwitchUsage, S.nContextSwitchUsage ? MICROPROFILE_CONTEXT_SWITCH_BUFFER_SIZE / S.nContextSwitchUsage : 0 ); #endif for(int i = 0; i < MICROPROFILE_MAX_THREADS; ++i)