This is an archive of the discontinued LLVM Phabricator instance.

Correctly report modified status for HWAddressSanitizer
ClosedPublic

Authored by serge-sans-paille on Jun 5 2020, 12:56 AM.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJun 5 2020, 12:56 AM
foad added inline comments.Jun 5 2020, 6:32 AM
llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
919

I don't understand this false. getDynamicShadowNonTls creates IR (unless it returns nullptr).

924

Likewise.

vitalybuka added a subscriber: vitalybuka.
vitalybuka added inline comments.
llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
1088

maybe do not bother with Changed and after this point always return true?

1136–1137

Changed = true?

1165

here and two ifs below?

serge-sans-paille marked an inline comment as done.

Take remarks into account.

serge-sans-paille marked 3 inline comments as done.Jun 9 2020, 7:37 AM
serge-sans-paille added inline comments.
llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
1088

It's possible that AllocasToInstrument ends up being empty, or AllocaToPaddedAllocaMap is empty, or OperandsToInstrument is non empty but with a mask that make all instrumentation fail.

foad added inline comments.Jun 9 2020, 8:10 AM
llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
1128–1130

You don't need braces around a single line.

Take review into account.

serge-sans-paille marked an inline comment as done.Jun 11 2020, 12:50 AM
vitalybuka added inline comments.Jun 11 2020, 3:15 AM
llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
1162

there are changes below. if we assume Changed is true by this point, then probably we should return true below?
maybe remove Changed and always return true after line 1140

Take review into account

HWAddressSanitizer LGTM, but looks like simplifyCFG is here by mistake?

llvm/lib/Transforms/Utils/SimplifyCFG.cpp
2765 ↗(On Diff #270157)

maybe move next after "IRBuilder<> Builder(PBI);"

Remove irrelevant part of the patch to focus on HWAdressSanitizer. Sorry for the noise.

@vitalybuka I removed the extra part of the patch, is it ok now?

This revision is now accepted and ready to land.Jun 17 2020, 1:26 PM
This revision was automatically updated to reflect the committed changes.