forked from OSchip/llvm-project
[flang] Check for having compiled the inverted map before using it
Original-commit: flang-compiler/f18@cef90ee11e Reviewed-on: https://github.com/flang-compiler/f18/pull/715 Tree-same-pre-rewrite: false
This commit is contained in:
parent
73329265ff
commit
be799e4300
|
@ -403,6 +403,8 @@ std::optional<ProvenanceRange> CookedSource::GetProvenanceRange(
|
|||
|
||||
std::optional<CharBlock> CookedSource::GetCharBlock(
|
||||
ProvenanceRange range) const {
|
||||
CHECK(!invertedMap_.empty() &&
|
||||
"CompileProvenanceRangeToOffsetMappings not called");
|
||||
if (auto to{invertedMap_.Map(range)}) {
|
||||
return CharBlock{data_.c_str() + *to, range.size()};
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue