Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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 <mcostalba@gmail.com>
  • Loading branch information...
commit fcecc5212e42794cba218fc1ffd39cd9da818655 1 parent 8de91be
@mcostalba authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/pawns.h
View
6 src/pawns.h
@@ -58,9 +58,9 @@ class PawnInfo {
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];
};
Please sign in to comment.
Something went wrong with that request. Please try again.