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

Fix wrong usage of std::remove_if [15204] #2853

Merged
merged 1 commit into from
Jul 21, 2022
Merged

Conversation

richiware
Copy link
Member

@richiware richiware commented Jul 20, 2022

Description

Function ReaderHistory::remove_changes_with_pred() is using std::remove_if in a wrong way. According to the
standard std::remove_if uses moveable assigments and the returned iterators contains unexpected data.

But this function is used the returned iterators to release CacheChanges and it is releasing wrong ones.

This PR fixes this.

This PR also fixes issue #2533.

Contributor Checklist

  • Commit messages follow the project guidelines.
  • The code follows the style guidelines of this project.
  • Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added.
  • Any new/modified methods have been properly documented using Doxygen.
  • Fast DDS test suite has been run locally.
  • Changes are ABI compatible.
  • Changes are API compatible.
  • Documentation builds and tests pass locally.
  • New feature has been added to the versions.md file (if applicable).
  • New feature has been documented/Current behavior is correctly described in the documentation.

Reviewer Checklist

  • Check contributor checklist is correct.
  • Check CI results: changes do not issue any warning.
  • Check CI results: failing tests are unrelated with the changes.

Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
@richiware richiware changed the title Fix wrong usage of std::remove_if Fix wrong usage of std::remove_if [15204] Jul 20, 2022
Copy link
Member

@MiguelCompany MiguelCompany left a comment

Choose a reason for hiding this comment

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

LGTM with green CI

@MiguelCompany MiguelCompany added this to the v2.7.1 milestone Jul 20, 2022
@MiguelCompany
Copy link
Member

@richiprosima Please test this

@MiguelCompany
Copy link
Member

@Mergifyio backport 2.6.x

@mergify
Copy link
Contributor

mergify bot commented Jul 21, 2022

backport 2.6.x

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Jul 21, 2022
Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
(cherry picked from commit 9bba04f)
Blast545 added a commit to Blast545/Fast-DDS that referenced this pull request Jul 21, 2022
This reverts commit 9bba04f.

Signed-off-by: Jorge Perez <jjperez@ekumenlabs.com>
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