From 5766bfc53ef4decb4d64c404c884b8ad891e01c6 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Mon, 15 May 2017 11:36:28 +0200 Subject: [PATCH] Make assert exits dependent on DEBUG switch The fatal assertion violations are now only occurring in a compile that has defined the DEBUG macro; normally action is taken to prevent the fault the error condition would ordinarily cause. --- dropper.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dropper.c b/dropper.c index c05fd91..6aa164d 100644 --- a/dropper.c +++ b/dropper.c @@ -9,6 +9,8 @@ #include #include +#define DEBUG 0 + #define LMR 2 #define ON 1 @@ -1116,7 +1118,7 @@ Search (int stm, int alpha, int beta, StackFrame *ff, int depth, int reduction, // legality int earlyGen = (ff->toPiece == stm+31); // King was moved -if(ply > 90) Dump("maxply"); + if(ply > 90) { if(DEBUG) Dump("maxply"); ff->depth = 0; return -ff->newEval+150; } f.xking = location[stm+31]; // opponent King, as stm not yet toggled if(!earlyGen && ff->mutation > 0) { // if other piece was moved (not dropped!), abort with +INF score if it was pinned if(Pinned(stm, ff->fromSqr, f.xking)) return INF; @@ -1155,10 +1157,10 @@ if(PATH)printf(" Hit, d=%d, checker = %x\n",entry->depth,f.checker); } } hashMove = entry->move; -if(hashMove && board[hashMove>>8&255] == 0) {char s[100];sprintf(s,"bad hash move %16llx: %s\n", f.hashKey, MoveToText(hashMove)); Dump(s); } hit = 1; p = board[hashMove>>8&255]; if(hashMove && ((p & stm) == 0 || p == -1)) { + if(DEBUG) printf("telluser bad hash move %16llx: %s\n", f.hashKey, MoveToText(hashMove)); hashMove = 0; f.checker = CK_UNKNOWN; } } else hit = hashMove = 0, f.checker = CK_UNKNOWN; @@ -1227,7 +1229,7 @@ if(hashMove && board[hashMove>>8&255] == 0) {char s[100];sprintf(s,"bad hash mov // move generation if(!earlyGen) { // generate moves if we had not done so yet if(MoveGen(stm, &m, f.rights)) { // impossible (except for hash collision giving wrong in-check status) - Dump("King capture"); + if(DEBUG) Dump("King capture"); ff->depth = MAXPLY; moveSP = oldSP; return INF; } if(f.checkDist && maxDepth <= 1) ipMask = SafeIP(&f); } -- 1.7.0.4