Skip to content
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

parser: Avoid reading after the end of shunting yard stack #209

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sin-ack
Copy link

@sin-ack sin-ack commented Oct 27, 2024

We would previously do this:

  • Erase items from the buffer
  • Read the items we just erased

This is a mistake because the vector might have resized itself after the erase call. This would cause assertion errors with the GNU STL. We now instead read the offsets we want to read from before performing the erase.

There may be other occurrences of this, but I've only hit these cases when compiling Xonotic.

We would previously do this:

- Erase items from the buffer
- Read the items we just erased

This is a mistake because the vector might have resized itself after the
erase call. This would cause assertion errors with the GNU STL. We now
instead read the offsets we want to read from before performing the
erase.

There may be other occurrences of this, but I've only hit these cases
when compiling Xonotic.
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