Skip to content

Commit c1a750b

Browse files
authored
[flang] Make sure range is valid (#104281)
Attempt to solve #102495
1 parent 4e078e3 commit c1a750b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

flang/lib/Parser/provenance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ static void EmitPrefix(llvm::raw_ostream &o, llvm::raw_ostream::Colors color,
248248

249249
std::optional<ProvenanceRange> AllSources::GetInclusionInfo(
250250
const std::optional<ProvenanceRange> &range) const {
251-
if (!range)
251+
if (!range || !IsValid(range->start()))
252252
return std::nullopt;
253253
const Origin &origin{MapToOrigin(range->start())};
254254

0 commit comments

Comments
 (0)