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

add assignment operator to int_vector_buffer iterator #364

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

niklasb
Copy link
Contributor

@niklasb niklasb commented Mar 9, 2017

Otherwise it cannot be used in sd_vector constructor, probably amongst others.

@tb-robot
Copy link
Collaborator

tb-robot commented Mar 9, 2017

Can one of the admins verify this patch?

@niklasb
Copy link
Contributor Author

niklasb commented Mar 9, 2017

Somehow this iterator implementation is broken and we don't know why. We spent 2 hours now debugging it to no avail. The operator- induces undefined behaviour, looks like it accesses uninitialized stack memory. Any thoughts @simongog?

@@ -549,15 +556,15 @@ class int_vector_buffer
return it += i;
}

iterator& operator-(difference_type i) const
Copy link
Owner

Choose a reason for hiding this comment

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

Isn't it enough to just remove the reference here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's enough to fix the bug, yes. This pull request is primarily about about adding an assignment operator though.

Copy link
Contributor Author

@niklasb niklasb left a comment

Choose a reason for hiding this comment

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

Any progress on this?

@@ -549,15 +556,15 @@ class int_vector_buffer
return it += i;
}

iterator& operator-(difference_type i) const
Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's enough to fix the bug, yes. This pull request is primarily about about adding an assignment operator though.

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.

3 participants