Index: flang/include/flang/Common/interval.h =================================================================== --- flang/include/flang/Common/interval.h +++ flang/include/flang/Common/interval.h @@ -93,7 +93,7 @@ return x - start_; } A OffsetMember(std::size_t n) const { - CHECK(n < size_); + CHECK(n <= size_); return start_ + n; } Index: flang/lib/Parser/provenance.cpp =================================================================== --- flang/lib/Parser/provenance.cpp +++ flang/lib/Parser/provenance.cpp @@ -91,7 +91,10 @@ } ProvenanceRange OffsetToProvenanceMappings::Map(std::size_t at) const { - // CHECK(!provenanceMap_.empty()); + if (provenanceMap_.empty()) { + CHECK(at == 0); + return {}; + } std::size_t low{0}, count{provenanceMap_.size()}; while (count > 1) { std::size_t mid{low + (count >> 1)};