From: Frode Solheim Date: Mon, 24 Aug 2015 18:57:41 +0000 (+0200) Subject: Fix undefined behavior (shift count == bit length) when delay is 0 X-Git-Tag: 3200~98^2 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=085ec5626ca20f77944278c68edde2b0dea42697;p=francis%2Fwinuae.git Fix undefined behavior (shift count == bit length) when delay is 0 --- 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; }