Using memset on a std::vector is undefined behavior,
so manually init all the data memebers of LimitsType.
Bug intorduced in
41641e3b1eea0038ab6984
No functional change.
#ifndef SEARCH_H_INCLUDED
#define SEARCH_H_INCLUDED
-#include <cstring>
#include <memory>
#include <stack>
#include <vector>
struct LimitsType {
- LimitsType() { std::memset(this, 0, sizeof(LimitsType)); }
+ LimitsType() { // Using memset on a std::vector is undefined behavior
+ time[WHITE] = time[BLACK] = inc[WHITE] = inc[BLACK] = movestogo =
+ depth = nodes = movetime = mate = infinite = ponder = 0;
+ }
bool use_time_management() const { return !(mate | movetime | depth | nodes | infinite); }
std::vector<Move> searchmoves;