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

Deletion from vector while looping over the vector #74

Closed
AbhishekBagchi opened this issue Aug 14, 2020 · 0 comments
Closed

Deletion from vector while looping over the vector #74

AbhishekBagchi opened this issue Aug 14, 2020 · 0 comments

Comments

@AbhishekBagchi
Copy link

In CommandAnalysis::getCommands, we're looping over the command list, and possibly deleting the elements as we go over the list and moving those elements to next_window_cmd_list.
So if the first element is a precharge that was inserted from the previous window in
if (!next_window_cmd_list.empty()) { list.insert(list.begin(), next_window_cmd_list.begin(), next_window_cmd_list.end()); next_window_cmd_list.clear(); }
In this case, element 0 gets deleted, so element 1 is at index 0 now, which gets skipped over. If that element is an ACT or RDA or WRA, this leads to an error.

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

No branches or pull requests

2 participants