forked from OSchip/llvm-project
[flang] Fix crash from -DMACRO= with empty replacement
Such macros were exposing some edge cases in the preprocessor regarding empty tokens. Differential Revision: https://reviews.llvm.org/D101207
This commit is contained in:
parent
1cc5946cc8
commit
0eb3299d28
|
@ -93,7 +93,7 @@ public:
|
||||||
return x - start_;
|
return x - start_;
|
||||||
}
|
}
|
||||||
A OffsetMember(std::size_t n) const {
|
A OffsetMember(std::size_t n) const {
|
||||||
CHECK(n < size_);
|
CHECK(n <= size_);
|
||||||
return start_ + n;
|
return start_ + n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,10 @@ void OffsetToProvenanceMappings::Put(const OffsetToProvenanceMappings &that) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ProvenanceRange OffsetToProvenanceMappings::Map(std::size_t at) const {
|
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()};
|
std::size_t low{0}, count{provenanceMap_.size()};
|
||||||
while (count > 1) {
|
while (count > 1) {
|
||||||
std::size_t mid{low + (count >> 1)};
|
std::size_t mid{low + (count >> 1)};
|
||||||
|
|
Loading…
Reference in New Issue