From 085ec5626ca20f77944278c68edde2b0dea42697 Mon Sep 17 00:00:00 2001 From: Frode Solheim Date: Mon, 24 Aug 2015 20:57:41 +0200 Subject: [PATCH] Fix undefined behavior (shift count == bit length) when delay is 0 --- custom.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom.cpp b/custom.cpp index 6f419def..9c2f5d4a 100644 --- a/custom.cpp +++ b/custom.cpp @@ -1943,6 +1943,7 @@ STATIC_INLINE void shift32plus (uae_u64 *p, int n) STATIC_INLINE void aga_shift (uae_u64 *p, int n) { + if (n == 0) return; shift32plus (p, n); p[0] <<= n; } @@ -1957,6 +1958,7 @@ STATIC_INLINE void shift32plusn (uae_u64 *p, int n) STATIC_INLINE void aga_shift_n (uae_u64 *p, int n) { + if (n == 0) return; shift32plusn (p, n); p[1] >>= n; } -- 2.47.3