Avoid overflow in bit-shift operation
authorFabian Fichter <ianfab@users.noreply.github.com>
Sun, 7 Oct 2018 13:59:18 +0000 (15:59 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sun, 7 Oct 2018 13:59:18 +0000 (15:59 +0200)
Fixes error in Travis build.

src/search.cpp

index acc23ca..4b3f817 100644 (file)
@@ -608,7 +608,7 @@ namespace {
     // search to overwrite a previous full search TT value, so we use a different
     // position key in case of an excluded move.
     excludedMove = ss->excludedMove;
-    posKey = pos.key() ^ Key(excludedMove << 16); // Isn't a very good hash
+    posKey = pos.key() ^ (Key(excludedMove) << 16); // Isn't a very good hash
     tte = TT.probe(posKey, ttHit);
     ttValue = ttHit ? value_from_tt(tte->value(), ss->ply) : VALUE_NONE;
     ttMove =  rootNode ? thisThread->rootMoves[thisThread->pvIdx].pv[0]