mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
Fix use of uninitialized variable
When initializing endgames map we build a faked FEN string in mat_key() to get the position hash's key. This fen string lacks full move numbers, so when parsing the fen in Position::from_fen() we leave startPosPly un-initialized. Spotted by Valgrind (this is a kind of bug that is almost impossible for humans to find). No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
500c7f44ab
commit
13524bea9b
1 changed files with 1 additions and 1 deletions
|
@ -87,7 +87,7 @@ namespace {
|
|||
do fen += char(tolower(keyCode[i])); while (++i < keyCode.length());
|
||||
|
||||
// Add file padding and remaining empty ranks
|
||||
fen += string(1, '0' + int(8 - keyCode.length())) + "/8/8/8/8/8/8/8 w - -";
|
||||
fen += string(1, '0' + int(8 - keyCode.length())) + "/8/8/8/8/8/8/8 w - - 0 10";
|
||||
|
||||
// Build a Position out of the fen string and get its material key
|
||||
return Position(fen, false, 0).get_material_key();
|
||||
|
|
Loading…
Add table
Reference in a new issue