]> git.sesse.net Git - stockfish/blobdiff - src/material.cpp
Fix DIVIDE BY ZERO exception in init_search()
[stockfish] / src / material.cpp
index a5f560baee15f29d1c250daaf18687a9ed173912..f2e501c1d862091545806cbc07b148e82e2754b5 100644 (file)
@@ -182,7 +182,7 @@ Phase MaterialInfoTable::game_phase(const Position& pos) {
 MaterialInfo* MaterialInfoTable::get_material_info(const Position& pos) {
 
   Key key = pos.get_material_key();
-  int index = key & (size - 1);
+  unsigned index = unsigned(key & (size - 1));
   MaterialInfo* mi = entries + index;
 
   // If mi->key matches the position's material hash key, it means that we