This is an archive of the discontinued LLVM Phabricator instance.

Fix memory issue in AttrBuilder::removeAttribute uses
ClosedPublic

Authored by dstenb on Oct 11 2016, 1:08 AM.

Details

Summary

Found when running Valgrind.

This removes two unnecessary assignments when using AttrBuilder::removeAttribute.

AttrBuilder::removeAttribute returns a reference to the object. As the LHSes were the same as the callees, the assignments resulted in memcpy calls where dst = src.

Diff Detail

Repository
rL LLVM

Event Timeline

dstenb updated this revision to Diff 74198.Oct 11 2016, 1:08 AM
dstenb retitled this revision from to Fix memory issue in AttrBuilder::removeAttribute uses.
dstenb updated this object.
dstenb added a subscriber: llvm-commits.
rnk accepted this revision.Oct 13 2016, 8:17 AM
rnk edited edge metadata.

lgtm

This revision is now accepted and ready to land.Oct 13 2016, 8:17 AM
This revision was automatically updated to reflect the committed changes.