From 3bcd05c6434764482580d8e784d4dd53f0fbbdca Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Mon, 23 Sep 2019 21:58:08 +0300 Subject: [PATCH] Array index fixed. --- cputest/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.47.3