This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Fix crash when diagnostic is emit with invalid location
ClosedPublic

Authored by PiotrZSL on Aug 10 2023, 1:30 PM.

Details

Summary

Fix crash when diagnostic is emit with invalid location,
but with attached valid ranges. Diagnostic can contain
invalid location, but SourceManager attached to it still
can be valid, use it in such case or fallback to known
SourceManager.

Fixes: #64602

Diff Detail

Event Timeline

PiotrZSL created this revision.Aug 10 2023, 1:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2023, 1:30 PM
Herald added a subscriber: xazax.hun. · View Herald Transcript
PiotrZSL requested review of this revision.Aug 10 2023, 1:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2023, 1:30 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
PiotrZSL updated this revision to Diff 549263.Aug 11 2023, 12:06 AM

Add call to DiagnosticEngine::hasSourceManager()

This revision is now accepted and ready to land.Aug 11 2023, 7:05 AM