Skip to content
Commit d7ea6068 authored by Peter Klausler's avatar Peter Klausler
Browse files

[flang] Avoid crash case in provenance mapping

When a contiguous range of a cooked character stream is being
mapped to a range of source provenance, the code was assuming
that the "end()" position of the input range -- being the character
immediately after the range -- would also follow the range's
source provenance.  This isn't always the case.

Modify the code to work with the true last character of the
input range (at end()-1) and to also cope with cases when that
last position truly maps to an earlier provenance, which can happen
when the prescanner has inserted a space into the cooked character
stream.

Differential Revision: https://reviews.llvm.org/D121124
parent 0c0636f7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment