[Ada] Compiler crash with -gnatR2 and with of child
Pierre-Marie de Rodat
derodat@adacore.com
Wed Jan 5 11:33:50 GMT 2022
This patch fixes a bug where if a parent library package contains a with
clause that mentions a child of that same parent package, then gnat can
crash if the parent package is compiled with the -gnatR2 switch.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* repinfo.adb (List_Entities): The code was assuming that if we
encounter a package in the current scope, then it must be
a (physically) nested package. That was wrong, because it could
be a child package. Avoid recursing into child packages; they
have not been annotated with representation information, and
-gnatR2 queries that information.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 999 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20220105/96b504e4/attachment.bin>
More information about the Gcc-patches
mailing list