This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Don't assume preprocessor macro is defined
ClosedPublic

Authored by ddcc on Mar 16 2022, 2:11 PM.

Diff Detail

Event Timeline

ddcc created this revision.Mar 16 2022, 2:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 16 2022, 2:11 PM
ddcc requested review of this revision.Mar 16 2022, 2:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 16 2022, 2:11 PM
vitalybuka added inline comments.Mar 16 2022, 5:14 PM
compiler-rt/lib/scudo/standalone/platform.h
40

isn't this evaluates to 0 if not defined?

ddcc added inline comments.Mar 17 2022, 10:21 AM
compiler-rt/lib/scudo/standalone/platform.h
40

Yes, but it emits a warning under -Wundef, and it's only ever supposed to be defined with value 1, so it's better to just check whether it's defined.

vitalybuka accepted this revision.Mar 17 2022, 12:32 PM
This revision is now accepted and ready to land.Mar 17 2022, 12:32 PM
This revision was automatically updated to reflect the committed changes.