This is an archive of the discontinued LLVM Phabricator instance.

[clang-doc] Add check for pointer validity
ClosedPublic

Authored by paulkirth on Jul 21 2022, 8:19 AM.

Details

Summary

clang-doc would SEGV when running over the Fuchsia code base.
This patch adds a check to avoid dereferencing potentially null pointers
in the Values vector. These pointers were either never valid or had been
invalidated when the underlying pointer in std::unique_ptr was moved from,
hence making it nullptr within the vector.

Diff Detail

Event Timeline

paulkirth created this revision.Jul 21 2022, 8:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2022, 8:19 AM
paulkirth requested review of this revision.Jul 21 2022, 8:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2022, 8:19 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
phosek accepted this revision.Jul 21 2022, 11:48 PM

LGTM

This revision is now accepted and ready to land.Jul 21 2022, 11:48 PM
This revision was automatically updated to reflect the committed changes.