Skip to content

Fixed possible going out of bounds behavior in list iterator decrements, detected in Debug build by VS 2026, that caused related assert to be triggered - #206

Open
mamontov-cpp wants to merge 1 commit into
KD-lab-Open-Source:mainfrom
mamontov-cpp:list-iterator-fixes
Open

mamontov-cpp wants to merge 1 commit into
KD-lab-Open-Source:mainfrom
mamontov-cpp:list-iterator-fixes

Conversation

@mamontov-cpp

Copy link
Copy Markdown

The main idea of this PR is to fix asserts obtained in debug builds on MSVS 2026. These asserts were triggered because, when deleting elements from linked std::lists, the code decremented an iterator that could already be at begin(). Accordingly, the decrement led to going out of bounds. The fix addresses this behavior by simply staying at the position of the new iterator when a deletion occurs, and moving forward if there was no deletion. The fix includes three places where this was found and reproduced in the game.

…ts, detected in Debug build by VS 2026, that caused related assert to be triggered
@CLAassistant

CLAassistant commented Oct 25, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

2 participants