aboutsummaryrefslogtreecommitdiff
path: root/libcpp/line-map.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcpp/line-map.c')
-rw-r--r--libcpp/line-map.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/libcpp/line-map.c b/libcpp/line-map.c
index 0e5804b..ac621e9 100644
--- a/libcpp/line-map.c
+++ b/libcpp/line-map.c
@@ -26,11 +26,6 @@ along with this program; see the file COPYING3. If not see
#include "internal.h"
#include "hashtab.h"
-/* Do not track column numbers higher than this one. As a result, the
- range of column_bits is [12, 18] (or 0 if column numbers are
- disabled). */
-const unsigned int LINE_MAP_MAX_COLUMN_NUMBER = (1U << 12);
-
/* Highest possible source location encoded within an ordinary or
macro map. */
const source_location LINE_MAP_MAX_SOURCE_LOCATION = 0x70000000;
@@ -2352,6 +2347,14 @@ rich_location::maybe_add_fixit (source_location start,
stop_supporting_fixits ();
return;
}
+ /* The columns must be in the correct order. This can fail if the
+ endpoints straddle the boundary for which the linemap can represent
+ columns (PR c/82050). */
+ if (exploc_start.column > exploc_next_loc.column)
+ {
+ stop_supporting_fixits ();
+ return;
+ }
const char *newline = strchr (new_content, '\n');
if (newline)