]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix usage of Table.Table in Fmap
authorRonan Desplanques <desplanques@adacore.com>
Thu, 25 Sep 2025 07:53:35 +0000 (09:53 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 6 Oct 2025 12:27:09 +0000 (14:27 +0200)
commite77f62626f20fbe7aaf81f55f75e16b36632ff38
treeb12dd0494bbf04d61aca769f04f9aa76cd581b3b
parent725e4c5760a9ac29a29a28ca59352dcd97f3ea9f
ada: Fix usage of Table.Table in Fmap

Table.Table can be instantiated to use either 0-based or 1-based
indexing, which can cause some confusion and make 0-based instances get
used as 1-based ones.

This was the case for two tables in Fmap before this patch. That did not
cause any bugs but allocated an extra cell in the arrays that went
unused.

This patch also replaces Increment_Last-and-assignment combos with
equivalent calls to Append.

gcc/ada/ChangeLog:

* fmap.adb (File_Mapping, Path_Mapping): Fix instantiations.
(Add_To_File_Map): Use Table.Table.Append.
gcc/ada/fmap.adb