Skip to content

Conversation

@bdeyal
Copy link
Contributor

@bdeyal bdeyal commented Aug 18, 2025

This commit Fixes the following crash scenario:

In Menus:
Click Edit | Setup Position...
Click Clear
Click on White King
CRASH

This commit checks in advance for InvalidSquare in function is AttackedBy().

The crash was: If a King is removed its square is set to InvalidSquare, Later when checking if that square is attacked we have a crash of accessing index beyond the board size.

This commit Fixes the following crash scenario:

In Menus:
Click Edit | Setup Position...
Click Clear
Click on White King
CRASH

This commit checks in advance for InvalidSquare in function
is AttackedBy().

The crash was: If a King is removed its square is set to InvalidSquare,
Later when checking if that square is attacked we have a crash of accessing
index beyond the board size.
@bdeyal bdeyal changed the title bitboard.h: check for invalid square at isAttackedBy() Fix a Crash: check for invalid square at isAttackedBy() (bitboard.h) Aug 18, 2025
@bdeyal
Copy link
Contributor Author

bdeyal commented Oct 3, 2025

@Isarhamster
Please note this crash and its fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant