From 961180c518bc7939a4b35dcb9f651176a6141e48 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 10 Dec 2012 13:28:37 +0100 Subject: [PATCH] Fix -fSAN in AnalyzeFile mode The exception that a PV relates to currentMove rather than forwardMostMove applies not oly in AnalyzeMode, but also in AnalyzeFile. Furthermore, PvToSan did not properly restore the pushed game tail in this case. --- backend.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend.c b/backend.c index 7f9b664..4b09ab8 100644 --- a/backend.c +++ b/backend.c @@ -5415,7 +5415,8 @@ ParsePV (char *pv, Boolean storeComments, Boolean atEnd) Boolean valid; int nr = 0; - if (gameMode == AnalyzeMode && currentMove < forwardMostMove) { + lastParseAttempt = pv; if(!*pv) return; // turns out we crash when we parse an empty PV + if ((gameMode == AnalyzeMode || gameMode == AnalyzeFile) && currentMove < forwardMostMove) { PushInner(currentMove, forwardMostMove); // [HGM] engine might not be thinking on forwardMost position! pushed = TRUE; } @@ -5520,7 +5521,7 @@ PvToSAN (char *pv) static char buf[10*MSG_SIZ]; int i, k=0, savedEnd=endPV, saveFMM = forwardMostMove; *buf = NULLCHAR; - if(forwardMostMove < endPV) PushInner(forwardMostMove, endPV); + if(forwardMostMove < endPV) PushInner(forwardMostMove, endPV); // shelve PV of PV-walk ParsePV(pv, FALSE, 2); // this appends PV to game, suppressing any display of it for(i = forwardMostMove; i