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

memcpy2memmove #1485

Merged
merged 1 commit into from Jun 11, 2019

Conversation

Projects
None yet
4 participants
@Adrian-Diaz
Copy link
Contributor

commented May 31, 2019

…ame source and destination arrays; this is not every instance of this issue in the source code

Summary

Avoids the possibility of undefined behavior in certain cases that use memcpy with the same source
and destination arrays. Should make valgrind reports cleaner etc.

Related Issues

Author(s)

Adrian Diaz (University of Florida)

Licensing

By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).

Backward Compatibility

Clear of Conflict

Implementation Notes

The problematic instances of memcpy are replaced with memmove

Post Submission Checklist

Please check the fields below as they are completed after the pull request has been submitted. Delete lines that don't apply

  • The feature or features in this pull request is complete
  • Licensing information is complete
  • Corresponding author information is complete
  • The source code follows the LAMMPS formatting guidelines
  • Suitable new documentation files and/or updates to the existing docs are included
  • The added/updated documentation is integrated and tested with the documentation build system
  • The feature has been verified to work with the conventional build system
  • The feature has been verified to work with the CMake based build system
  • A package specific README file has been included or updated
  • One or more example input decks are included

Further Information, Files, and Links

avoids the possibility of undefined behavior with memcpy having the s…
…ame source and destination arrays; this is not every instance of this issue in the source code

@Adrian-Diaz Adrian-Diaz requested a review from sjplimp as a code owner May 31, 2019

@Adrian-Diaz Adrian-Diaz changed the title avoids the possibility of undefined behavior with memcpy having the s… memcpy2memmove May 31, 2019

@akohlmey akohlmey added this to the Stable Release Summer 2019 milestone May 31, 2019

@stanmoore1
Copy link
Contributor

left a comment

Looks good to me. I've also noticed the Valgrind warnings.

@akohlmey

This comment has been minimized.

Copy link
Member

commented Jun 11, 2019

@sjplimp please have a look and approve/assign to me or state any objections.

@sjplimp
Copy link
Contributor

left a comment

good to go

@sjplimp sjplimp removed their assignment Jun 11, 2019

@akohlmey akohlmey merged commit 1dc8bb1 into lammps:master Jun 11, 2019

6 checks passed

lammps/pull-requests/build-docs-pr head run ended
Details
lammps/pull-requests/cmake/cmake-serial-pr head run ended
Details
lammps/pull-requests/kokkos-omp-pr head run ended
Details
lammps/pull-requests/openmpi-pr head run ended
Details
lammps/pull-requests/serial-pr head run ended
Details
lammps/pull-requests/shlib-pr head run ended
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.