From f9a166a08bf80f2947827e56b200b17e693a6502 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Mon, 15 May 2017 21:45:31 +0200 Subject: [PATCH] Reduce maxDepth The maximum search depth is now set to MAXPLY-2, to prevent overflow in arrays with MAXPLY elements. --- dropper.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dropper.c b/dropper.c index 37111d0..4d86e30 100644 --- a/dropper.c +++ b/dropper.c @@ -35,7 +35,7 @@ #define C_CONTACT 0x00FF int ply, nodeCount, forceMove, choice, rootMove, lastGameMove, rootScore, abortFlag, postThinking=1; // some frequently used data -int maxDepth=MAXPLY, timeControl=3000, mps=40, inc, timePerMove, timeLeft=1000; // TC parameters +int maxDepth=MAXPLY-2, timeControl=3000, mps=40, inc, timePerMove, timeLeft=1000; // TC parameters #define H_LOWER 1 #define H_UPPER 2 @@ -1768,7 +1768,7 @@ printf("# command: %s\n", inBuf); if(!strcmp(command, "memory")) { if(SetMemorySize(atoi(inBuf+7))) printf("tellusererror Not enough memory\n"), exit(-1); return 1; } if(!strcmp(command, "ping")) { printf("pong%s", inBuf+4); return 1; } // if(!strcmp(command, "")) { sscanf(inBuf, " %d", &); return 1; } - if(!strcmp(command, "new")) { engineSide = BLACK; stm = WHITE; maxDepth = MAXPLY; randomize = OFF; moveNr = 0; ranKey = GetTickCount() | 0x1001; return 1; } + if(!strcmp(command, "new")) { engineSide = BLACK; stm = WHITE; maxDepth = MAXPLY-2; randomize = OFF; moveNr = 0; ranKey = GetTickCount() | 0x1001; return 1; } if(!strcmp(command, "variant")) { GameInit(inBuf + 8); Setup(startPos); return 1; } if(!strcmp(command, "setboard")){ engineSide = NONE; stm = Setup(inBuf+9); return 1; } if(!strcmp(command, "undo")) { TakeBack(1); return 1; } -- 1.7.0.4