From ecb42cad9b30f04339edf840dbf8a98779da211e Mon Sep 17 00:00:00 2001 From: ramapcsx2 Date: Tue, 1 Jul 2014 15:43:26 +0200 Subject: [PATCH] Thanks Bluefire101 for reporting this (eventually) undefined behavior (depending on who you ask). Even if there was no problem, code should always be clear on what it does. --- common/include/x86emitter/x86types.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/include/x86emitter/x86types.h b/common/include/x86emitter/x86types.h index 9c5ead8fc7..8d99e7005f 100644 --- a/common/include/x86emitter/x86types.h +++ b/common/include/x86emitter/x86types.h @@ -366,13 +366,15 @@ template< typename T > void xWrite( T val ); xRegisterSSE& operator++() { - ++Id &= (iREGCNT_XMM-1); + ++Id; + Id &= (iREGCNT_XMM - 1); return *this; } xRegisterSSE& operator--() { - --Id &= (iREGCNT_XMM-1); + --Id; + Id &= (iREGCNT_XMM - 1); return *this; }