From: Marco Costalba Date: Sun, 15 Mar 2009 17:06:40 +0000 (+0100) Subject: Fix an overflow bug in pawns stormValue X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=fcecc5212e42794cba218fc1ffd39cd9da818655;hp=8de91be61e0910936e3d6be6e1033a4fb8537dca Fix an overflow bug in pawns stormValue 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 --- diff --git a/src/pawns.h b/src/pawns.h index 7d3e9252..673bcfa5 100644 --- a/src/pawns.h +++ b/src/pawns.h @@ -58,9 +58,9 @@ private: 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]; };