diff options
author | Peter Klausler <pklausler@nvidia.com> | 2022-02-18 10:17:04 -0800 |
---|---|---|
committer | Peter Klausler <pklausler@nvidia.com> | 2022-03-02 15:24:35 -0800 |
commit | 93f42491a54cd30b6b873f6818ea39f282e8ef6c (patch) | |
tree | 8d81d61170c44b83a0786520b4b02ec3d1d4c75b /llvm/lib/Object/ELFObjectFile.cpp | |
parent | 79f8e909ed63deec10906f4033b771433e8104c0 (diff) | |
download | llvm-93f42491a54cd30b6b873f6818ea39f282e8ef6c.zip llvm-93f42491a54cd30b6b873f6818ea39f282e8ef6c.tar.gz llvm-93f42491a54cd30b6b873f6818ea39f282e8ef6c.tar.bz2 |
[flang] Extend ProvenanceRange::Suffix() to handle crash case
Suffix() can be called from AllSources::IntersectionWithSourceFiles()
when a contiguous range of source provenance overlaps a macro expansion.
It skips over the macro expansion and recurses on the remainder of
the range, which might end with a bit that does overlap with a
source file. However, in the case where the original range is
entirely within the expanded macro, Suffix() crashes when called
with a skip offset greater than the size of the range.
Rather than add logic around this and other calls to Suffix() to
avoid passing an out-of-range skip, it's better to accommodate it
in Suffix() and return an empty result.
Differential Revision: https://reviews.llvm.org/D120843
Diffstat (limited to 'llvm/lib/Object/ELFObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions