ada: Fix address arithmetic issues in the expanded code
commit544d5ff153b3470126cd2c9095617c1c084d418d
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 22 Feb 2023 16:00:06 +0000 (22 17:00 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 23 May 2023 07:59:06 +0000 (23 09:59 +0200)
treecbd53567b4ae07c49696680b04676534fe29549e
parent6efcce36f571da77a7122d3d1ae75739d744fe88
ada: Fix address arithmetic issues in the expanded code

This is most notably the addition of addresses in Expand_Interface_Thunk.
There is also a small change to Expand_Dispatching_Call, which was directly
accessing a class-wide interface object as a tag, thus giving rise later to
unchecked conversions between either the root or the equivalent record type
and access types.

gcc/ada/

* exp_disp.adb (Expand_Dispatching_Call): In the abstract interface
class-wide case, use 'Tag of the object as the controlling tag.
(Expand_Interface_Thunk): Perform address arithmetic using operators
of System.Storage_Elements.
gcc/ada/exp_disp.adb