From 42d9b4a868b065bf6f5e4ff2e81ca3f751999886 Mon Sep 17 00:00:00 2001 From: Matthies Date: Wed, 7 Jul 2021 17:14:31 +0200 Subject: [PATCH] Avoid empty move list in last pv when using multiple threads. --- src/search.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 883f2809..5e010a05 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1356,15 +1356,19 @@ static void search_gen1(searchthread *thr) } } - // copy new pv to lastpv - int i = 0; - while (pos->pvtable[0][i]) + int i; + if (pos->pvtable[0][0]) { - pos->lastpv[i] = pos->pvtable[0][i]; - i++; - if (i == MAXDEPTH - 1) break; + // copy new pv to lastpv + i = 0; + while (pos->pvtable[0][i]) + { + pos->lastpv[i] = pos->pvtable[0][i]; + i++; + if (i == MAXDEPTH - 1) break; + } + pos->lastpv[i] = 0; } - pos->lastpv[i] = 0; nowtime = getTime();