From: Toni Wilen Date: Mon, 23 Sep 2019 18:58:08 +0000 (+0300) Subject: Array index fixed. X-Git-Tag: 4300~102 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=3bcd05c6434764482580d8e784d4dd53f0fbbdca;p=francis%2Fwinuae.git Array index fixed. --- diff --git a/cputest/main.c b/cputest/main.c index 9f8554cb..9b2315bf 100644 --- a/cputest/main.c +++ b/cputest/main.c @@ -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;