-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/fix issue425 #430
base: develop
Are you sure you want to change the base?
Feature/fix issue425 #430
Conversation
…ementation. Also eliminating some cppcheck warnings.
Thanks for this fix. What do you think of simply extending GuardDir to [nr_piece_walks-Pawn] instead? Seems simpler, and would prepare us for extending intelligent mode to more piece types in the future (a constantly requested feature, even if the requests don't agree on what piece types :-) ). |
There's nothing wrong with either of those alternatives. Indeed, a big benefit of abstracting the |
This is my proposed fix for Issue #425. In that Issue the problem is that when Popeye is run on
line 288 of
optimisations/intelligent/mate/generate_doublechecking_moves.c
attempts to examineGuardDir[Dummy-Pawn]
which, of course, doesn't exist.This fix abstracts the
GuardDir
interface, allowing us to easily provide aguard_dir_struct
for any piece we may eventually desire, constructed in whatever way is most convenient. (For now, I've only addedDummy
, in the way that I feel is appropriate.) This update also allows us to add someassert
s so that we can catch similar errors going forward.Though I believe these changes are worthwhile, and they do eliminate the invalid accesses in the Issue, I do want to mention a few points. That line of code looks for
GuardDir[Dummy-Pawn]
, but no other parts of the code seem to do so. It findsDummy
inpieces_pawns_promotee_sequence[pieces_pawns_promotee_chain_orthodox]
, which certainly seems odd (to me) asDummy
isn't an orthodox piece. Thus, it's conceivable thatDummy
shouldn't be appearing there, that there's a bug elsewhere that's causing this to happen that should be fixed. Someone who better understands this infrastructure should weigh in here.