This is an archive of the discontinued LLVM Phabricator instance.

[local-bounds] Ignore volatile operations
ClosedPublic

Authored by vitalybuka on Apr 21 2020, 7:25 PM.

Details

Summary

-fsanitize=local-bounds is very similar to `object-size` and
should also ignore volatile pointers.
https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#volatile

Diff Detail

Event Timeline

vitalybuka created this revision.Apr 21 2020, 7:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2020, 7:25 PM
rsmith added a comment.May 5 2020, 1:46 PM

Code change looks fine, and it makes sense to me to apply the same rules to both the local-bounds and the object-size sanitizer, since they're checking the same thing. Please also update the documentation you linked to, to indicate that the local-bounds sanitizer also ignores volatile accesses.

vitalybuka retitled this revision from [bounds] Ignore volatile operations to [local-bounds] Ignore volatile operations.May 5 2020, 3:38 PM
vitalybuka edited the summary of this revision. (Show Details)
vitalybuka edited the summary of this revision. (Show Details)
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2020, 3:39 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
vitalybuka updated this revision to Diff 262240.May 5 2020, 3:40 PM

updated doc

Harbormaster completed remote builds in B55856: Diff 262240.
rsmith accepted this revision.May 5 2020, 4:37 PM
rsmith added inline comments.
clang/docs/UndefinedBehaviorSanitizer.rst
176–179

While we're here we should mention that local-bounds isn't part of undefined.

This revision is now accepted and ready to land.May 5 2020, 4:37 PM
vitalybuka marked an inline comment as done.

add =undefined note

This revision was automatically updated to reflect the committed changes.