]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Wrong address for class-wide interface access conversion
authorJavier Miranda <miranda@adacore.com>
Tue, 15 Feb 2022 18:39:42 +0000 (18:39 +0000)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 13 May 2022 08:04:33 +0000 (08:04 +0000)
commit18e278727e1a0430f50e878dbfadb35dae54baff
tree8c820be7b8f3304863de8038754601f6263b1c35
parentfafccfbf77ac245c7fa77c06e4ae001009c3425e
[Ada] Wrong address for class-wide interface access conversion

The compiler generates wrong code on instantiations of package
Address_To_Access_Conversions when the generic formal is a class-wide
interface type; this causes wrong dispatching calls when the
access-to-class-wide-interface object returned by To_Pointer is used to
dispatch a call.

gcc/ada/

* exp_attr.adb (Expand_N_Attribute_Reference): The expansion of
'Address in a call to an instantiation of the implicit
subprogram To_Pointer with a class-wide interface type target
requires adding an implicit type conversion to force
displacement of the "this" pointer.
gcc/ada/exp_attr.adb