[Ada] Crash in interface derivation with null primitive
authorJavier Miranda <miranda@adacore.com>
Mon, 8 Jul 2019 08:13:20 +0000 (08:13 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 8 Jul 2019 08:13:20 +0000 (08:13 +0000)
commit4a0e6ac18f731f41f7ddfa05c370186cd32bef52
tree35a93152f966dad625f9964c1d9d8ff0c426597f
parent23eb3cb2b4fb900398461410c6c31294fc77cfc6
[Ada] Crash in interface derivation with null primitive

The frontend crashes processing the derivation of a tagged type whose
ultimate ancestor is an interface type I1 that has a null primitive,
implements another interface I2 derived from I2, and does not override
the null primitive.

2019-07-08  Javier Miranda  <miranda@adacore.com>

gcc/ada/

* exp_disp.adb (Register_Primitive): When registering a
primitive in the secondary dispatch table, handle primitive
inherited through several levels of type derivation (required to
properly handle inherited 'null' primitive).

gcc/testsuite/

* gnat.dg/interface9.adb, gnat.dg/interface9_root-child.ads,
gnat.dg/interface9_root.ads: New testcase.

From-SVN: r273204
gcc/ada/ChangeLog
gcc/ada/exp_disp.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/interface9.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/interface9_root-child.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/interface9_root.ads [new file with mode: 0644]