ada: Add guard before querying the type for its interfaces
commit4e61fc48f58c16427593ded7fdd0ff49bed897b0
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 23 Aug 2023 14:02:21 +0000 (23 16:02 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 5 Sep 2023 11:05:16 +0000 (5 13:05 +0200)
tree11c559a54b358cea630303561db7afff27b6203d
parente394afd4a584fb4546be3b79270620f79989a387
ada: Add guard before querying the type for its interfaces

Fix crash on illegal code, when routine Iface_Present_In_Ancestor is
called on the predefined String type and attempts to examine the list of
interfaces.

gcc/ada/

* sem_type.adb (Iface_Present_In_Ancestor): Only look at the list of
interfaces for types that allow it. The guard is a high-level equivalent
of the entity kinds listed in the preconditon of the Interfaces query.
gcc/ada/sem_type.adb