Skip to content

removed asserts#43

Merged
winapiadmin merged 1 commit intomainfrom
42-a-null-move-is-not-ok
Mar 29, 2026
Merged

removed asserts#43
winapiadmin merged 1 commit intomainfrom
42-a-null-move-is-not-ok

Conversation

@winapiadmin
Copy link
Copy Markdown
Owner

Fixes #42

@winapiadmin winapiadmin linked an issue Mar 29, 2026 that may be closed by this pull request
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

chesslib/position.h

Lines 175 to 176 in 3e31a33

current_state = history.back();
history.pop_back();

P2 Badge Guard undoMove against empty history

Calling undoMove() when no prior move was pushed (for example immediately after setFEN() or after one extra undo) now reaches history.back()/pop_back() on an empty vector, which is undefined behavior and can crash in debug/test runs. The removed assert(!history.empty()) was the only local guard here, so this commit regresses fail-fast behavior into memory-unsafe behavior for a publicly callable method.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@winapiadmin winapiadmin merged commit 68a650e into main Mar 29, 2026
17 of 47 checks passed
@winapiadmin winapiadmin deleted the 42-a-null-move-is-not-ok branch March 29, 2026 08:26
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.

a null move is not ok

1 participant