]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix address arithmetic issues in the runtime
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 22 Feb 2023 13:43:37 +0000 (14:43 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 23 May 2023 07:59:05 +0000 (09:59 +0200)
commit6efcce36f571da77a7122d3d1ae75739d744fe88
treea8976710a9d9dac26afc23b48a19050852d8ad0c
parent0fb36084e3ef8fb0eef232b41a8257f119b26864
ada: Fix address arithmetic issues in the runtime

This is most notably the addition of addresses in Interfaces.C.Pointers and
System.Bitfield_Utils.  There is also a change to System.Stream_Attributes,
which was representing a thin pointer as a record, which is not problematic
per se, but is in the end, because the expanded code performs an unchecked
conversion from it to the access type instead of accessing the component.

gcc/ada/

* libgnat/i-cpoint.adb: Add clauses for System.Storage_Elements.
(Addr): Delete.
(Offset): New subtype of Storage_Offset.
(To_Offset): New instance of Unchecked_Conversion.
(To_Pointer): Adjust.
(To_Addr): Likewise.
(To_Ptrdiff): Likewise.
("+"): Call To_Offset on the offset.
("-"): Likewise.
* libgnat/s-bituti.adb: Add clauses for System.Storage_Elements.
(Val_Bytes): Change type to Storage_Count.
(Get_Val_2): Add qualification to second operand of mod operator.
(Set_Val_2): Likewise.
(Copy_Bitfield): Likewise.  Change type of Src_Adjust & Dest_Adjust.
* libgnat/s-stratt.ads (Thin_Pointer): Change to subtype of Address.
* libgnat/s-statxd.adb (I_AD): Adjust.
(I_AS): Likewise.
(W_AS): Likewise.
gcc/ada/libgnat/i-cpoint.adb
gcc/ada/libgnat/s-bituti.adb
gcc/ada/libgnat/s-statxd.adb
gcc/ada/libgnat/s-stratt.ads