From aee547aa0eb3bd274117616eddd036634bbe59de Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Tue, 3 May 2022 22:01:33 +0100 Subject: [PATCH] AX: prevent undefined behavior u16 gets promoted to s32 where changing the uppermost bit is UB. --- Source/Core/Core/HW/DSPHLE/UCodes/AXVoice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/AXVoice.h b/Source/Core/Core/HW/DSPHLE/UCodes/AXVoice.h index d732cc066d..f40f17cb6d 100644 --- a/Source/Core/Core/HW/DSPHLE/UCodes/AXVoice.h +++ b/Source/Core/Core/HW/DSPHLE/UCodes/AXVoice.h @@ -44,7 +44,7 @@ inline namespace AXWii namespace { // Useful macro to convert xxx_hi + xxx_lo to xxx for 32 bits. -#define HILO_TO_32(name) ((name##_hi << 16) | name##_lo) +#define HILO_TO_32(name) ((u32(name##_hi) << 16) | name##_lo) // Used to pass a large amount of buffers to the mixing function. union AXBuffers