This is an archive of the discontinued LLVM Phabricator instance.

[FunctionAttrs] Re-enable propagation of nonnull argument attributes from callsites to callers
AbandonedPublic

Authored by xbolva00 on Sep 27 2018, 3:11 PM.

Details

Reviewers
efriedma
spatel
Summary

Some time ago, this propagation was disabled due to some security concers:
http://lists.llvm.org/pipermail/cfe-dev/2017-January/052066.html

Later, this issue was fixed on Clang side in https://reviews.llvm.org/rC298491. This patch (re)enables it by default in LLVM.

Diff Detail

Event Timeline

xbolva00 created this revision.Sep 27 2018, 3:11 PM
xbolva00 updated this revision to Diff 167406.Sep 27 2018, 3:17 PM
xbolva00 updated this revision to Diff 167409.Sep 27 2018, 3:30 PM
xbolva00 retitled this revision from [FunctionAttrs] Propagate nonnull argument attributes from callsites to callers to [FunctionAttrs] Re-enable propagation of nonnull argument attributes from callsites to callers.

Later, this issue was fixed on Clang side in https://reviews.llvm.org/rC298491. This patch (re)enables it by default in LLVM.

Repeating a comment from the now closed D30806 for reference:

But it got reverted soon after due to miscompiles:
https://reviews.llvm.org/rL298695

And the functionality hasn't been reimplemented AFAICT.

xbolva00 abandoned this revision.Sep 27 2018, 4:14 PM

Ah, okay then. Closing this rev.

xbolva00 added a comment.EditedSep 28 2018, 5:34 AM

Btw, cannot we just drop nonnull arg info (which we get from libc annotations) related to problematic functions (like memcpy, strncmp,..) ?

And then we can mark these function args "safely" at callsites.

xbolva00 reclaimed this revision.Sep 28 2018, 5:34 AM

Btw, cannot we just drop nonnull arg info (which we get from libc annotations) related to problematic functions (like memcpy, strncmp,..) ?

And then we can mark these function args "safely" at callsites.

I don't understand all of the details, so I recommend reviving D30806 or the dev-thread that led to it to discuss further how to proceed with this patch.
You might also be interested in applying/commandeering D29999 and chasing down how it broke everything. :)

xbolva00 abandoned this revision.Oct 13 2018, 3:32 PM