Fix the resizing condition of the line table
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Thu, 12 Mar 2020 10:52:34 +0000 (11:52 +0100)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Wed, 1 Apr 2020 21:37:46 +0000 (23:37 +0200)
That was wasting one element.

2020-04-01  Bernd Edlinger  <bernd.edlinger@hotmail.de>

* buildsym.c (record_line): Fix the resizing condition.

gdb/ChangeLog
gdb/buildsym.c

index 12f099559b85f2b571838b72fdd4cc6ec31a870f..b94acffed668893bbf790f3612affbc79ad24681 100644 (file)
@@ -1,3 +1,7 @@
+2020-04-01  Bernd Edlinger  <bernd.edlinger@hotmail.de>
+
+       * buildsym.c (record_line): Fix the resizing condition.
+
 2020-04-01  Tom Tromey  <tom@tromey.com>
 
        * value.h (value_literal_complex): Add comment.
index 7155db34b085c36ea3c4d599be8a2151c8bfa889..2d1e4419d836e53cb51290d5cdf1b09139efda33 100644 (file)
@@ -695,7 +695,7 @@ buildsym_compunit::record_line (struct subfile *subfile, int line,
        }
     }
 
-  if (subfile->line_vector->nitems + 1 >= subfile->line_vector_length)
+  if (subfile->line_vector->nitems >= subfile->line_vector_length)
     {
       subfile->line_vector_length *= 2;
       subfile->line_vector = (struct linetable *)