]> git.sesse.net Git - stockfish/commitdiff
Fix an overflow bug in pawns stormValue
authorMarco Costalba <mcostalba@gmail.com>
Sun, 15 Mar 2009 17:06:40 +0000 (18:06 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 15 Mar 2009 17:18:56 +0000 (18:18 +0100)
These fields are defined as int8_t but values bigger
then 127 are stored there so that we silently overflow.

Fix bringing up all the fields to a sane int type. This
will increase memory usage, but apart from being safe, it is
not clear if code is slower or faster. Test is needed.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/pawns.h

index 7d3e92522c83b0f668cdd6262e90190609e4a27f..673bcfa5060345002effbb8e71d5f8b739c4303b 100644 (file)
@@ -58,9 +58,9 @@ private:
 
   Key key;
   Bitboard passedPawns;
 
   Key key;
   Bitboard passedPawns;
-  int16_t mgValue, egValue;
-  int8_t ksStormValue[2], qsStormValue[2];
-  uint8_t halfOpenFiles[2];
+  int mgValue, egValue;
+  int ksStormValue[2], qsStormValue[2];
+  int halfOpenFiles[2];
 };
 
 
 };