[PATCH] D42789: [dfsan] Correctly copy attributes to variadic custom wrapper

Daniel Neilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 22 10:53:16 PST 2018


dneilson accepted this revision.
dneilson added a comment.
This revision is now accepted and ready to land.

Not terribly familiar with this code, but my understanding from reading the construction of the CustomCI for WK_Custom...

The new CI that's being constructed has as arguments: All of the regular non-varargs args, then the shadow args for those regular args, and then the varargs from the original CI. The blind setAttribute on line 1534 was a problem because it would end up setting the attributes associated with varargs in the original CI to shadow args in the new CI -- because the attribute list is an ordered list and there was no bubble/hole created in the list to accommodate the shadow args that are inserted between the regular and varargs arguments. So, the solution is to be more careful -- your change is just creating a new attribute list from the old one with the exception that you inject a bubble/hole of empty attribute sets where the shadow arguments would go.

Logic seems good to me. Added code and test both look fine to me.

Thanks for the patch!


https://reviews.llvm.org/D42789





More information about the llvm-commits mailing list