]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Array index fixed.
authorToni Wilen <twilen@winuae.net>
Mon, 23 Sep 2019 18:58:08 +0000 (21:58 +0300)
committerToni Wilen <twilen@winuae.net>
Mon, 23 Sep 2019 18:58:08 +0000 (21:58 +0300)
cputest/main.c

index 9f8554cba0ee92092d40b3ff70158d0c382bede0..9b2315bfb856e3ba92f83b9f2d76814e0714e017 100644 (file)
@@ -572,8 +572,10 @@ static void tomem(uae_u8 *p, uae_u32 v, uae_u32 oldv, int size, int storedata)
 
 static void restoreahist(void)
 {
+       if (!ahcnt)
+               return;
        for (int i = ahcnt - 1; i >= 0; i--) {
-               struct accesshistory *ah = &ahist[ahcnt];
+               struct accesshistory *ah = &ahist[i];
                tomem(ah->addr, ah->oldval, 0, ah->size, 0);
        }
        ahcnt = 0;