[PATCH] Fix incorrect line numbers in large files bug#108900

2024-11-18 Thread Jeremy Bettis
Patch to fix known bug from
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108900

diff -ur gcc-clean/gcc-14.2.0/libcpp/files.cc gcc-14.2.0/libcpp/files.cc
--- gcc-clean/gcc-14.2.0/libcpp/files.cc 2024-08-01 08:17:17.0 +
+++ gcc-14.2.0/libcpp/files.cc 2024-10-18 18:42:42.293245597 +
@@ -1005,6 +1005,11 @@
 && type < IT_DIRECTIVE_HWM
 && (pfile->line_table->highest_location
  != LINE_MAP_MAX_LOCATION - 1));
+  if (decrement && LINEMAPS_ORDINARY_USED (pfile->line_table)) {
+const line_map_ordinary *map = LINEMAPS_LAST_ORDINARY_MAP
(pfile->line_table);
+if (map && map->start_location == pfile->line_table->highest_location)
+  decrement = false;
+  }
   if (decrement)
 pfile->line_table->highest_location--;


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [PATCH] Fix incorrect line numbers in large files bug#108900

2024-12-06 Thread Jeremy Bettis
On Fri, Dec 6, 2024 at 5:27 AM Sam James  wrote:

> Please ideally use git-send-email and see
> https://gcc.gnu.org/contribute.html#patches wrt ChangeLog format and so
> on.
>
>
Perhaps you should document in that contribute page how to install
git-send-email. It is not a standard git command.

In any case, you have the patch here, and also in the linked bug. I'm sure
you can apply it if you want the bug fixed.

-- 
Jeremy Bettis | ChromeOS FAFT lead


smime.p7s
Description: S/MIME Cryptographic Signature