[flang] Make sure range is valid (#104281)

Attempt to solve #102495
This commit is contained in:
Valentin Clement (バレンタイン クレメン)
2024-08-15 14:11:03 -07:00
committed by GitHub
parent 4e078e3797
commit c1a750b8bf

View File

@@ -248,7 +248,7 @@ static void EmitPrefix(llvm::raw_ostream &o, llvm::raw_ostream::Colors color,
std::optional<ProvenanceRange> AllSources::GetInclusionInfo(
const std::optional<ProvenanceRange> &range) const {
if (!range)
if (!range || !IsValid(range->start()))
return std::nullopt;
const Origin &origin{MapToOrigin(range->start())};