From: H.G.Muller Date: Wed, 8 Oct 2025 08:54:59 +0000 (+0200) Subject: Reduce crash risk X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=c7d6baff248a83f032fb7eaeaf634c597726472d;p=hachu.git Reduce crash risk Some arrays are enlarged to avoid they will overflow at large search depth. --- diff --git a/hachu.c b/hachu.c index 6ab5442..ee53b1e 100644 --- a/hachu.c +++ b/hachu.c @@ -168,7 +168,7 @@ int retMSP, retFirst, retDep, pvPtr, level, cnt50, mobilityScore; int ll, lr, ul, ur; // corner squares int nodes, startTime, lastRootMove, lastRootIter, tlim1, tlim2, tlim3, repCnt, comp, abortFlag; Move ponderMove; -Move retMove, moveStack[20000], path[100], repStack[300], pv[1000], repeatMove[300], killer[100][2]; +Move retMove, moveStack[80000], path[200], repStack[400], pv[10000], repeatMove[300], killer[200][2]; int maxDepth; // used by search @@ -3033,7 +3033,7 @@ pboard(board); } continue; } - if(!strcmp(command, "sd")) { sscanf(inBuf, "sd %d", &maxDepth); continue; } + if(!strcmp(command, "sd")) { sscanf(inBuf, "sd %d", &maxDepth); maxDepth &= 63; continue; } if(!strcmp(command, "st")) { sscanf(inBuf, "st %d", &timePerMove); continue; } if(!strcmp(command, "memory")) { SetMemorySize(atoi(inBuf+7)); continue; }