This is an archive of the discontinued LLVM Phabricator instance.

Make diagnostics API safer to use
ClosedPublic

Authored by aprantl on Apr 20 2023, 11:19 AM.

Details

Summary

I received a crash report in DiagnosticManager that was causes by a nullptr diagnostic having been added. The API allows passing in a null unique_ptr, but all the methods are written assuming that all pointers a dereferencable. This patch makes it impossible to add a null diagnostic.

rdar://107633615

Diff Detail

Event Timeline

aprantl created this revision.Apr 20 2023, 11:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 20 2023, 11:19 AM
aprantl requested review of this revision.Apr 20 2023, 11:19 AM
This revision is now accepted and ready to land.Apr 20 2023, 11:25 AM
mib accepted this revision.Apr 20 2023, 11:26 AM
mib added a subscriber: mib.

LGTM!

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2023, 8:22 AM