Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We use following line to clamp the search depth in some range: Depth d = std::clamp(newDepth - r, 1, newDepth + 1); Through negative extension its possible that the maximum value becomes smaller than the minimum value but then the behavior is undefined (see https://en.cppreference.com/w/cpp/algorithm/clamp). So replace this line with a save implementation. Remark: We have in recent master already one line where up to 3 negative extensions are possible which would could trigger this undefined behavior but we had the luck (or bad luck depending on the view point) that this until now was not discovered. Recent negative extension tests by @fauzi shows then this undefined behavior with wrong bench numbers. Bench: 1334248
- Loading branch information