aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/init.c
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2022-05-06 17:23:25 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2022-06-01 08:43:18 +0000
commit2ae98c3a75102cb4dbb9b8da690952a9971d4e93 (patch)
tree41d67a485a44a5bc854e1d19b27b0a4fe1cc3f3e /gcc/ada/init.c
parent8182602c5061ddc9c329ecef26a7fd77b9264ec0 (diff)
downloadgcc-2ae98c3a75102cb4dbb9b8da690952a9971d4e93.zip
gcc-2ae98c3a75102cb4dbb9b8da690952a9971d4e93.tar.gz
gcc-2ae98c3a75102cb4dbb9b8da690952a9971d4e93.tar.bz2
[Ada] Propagate null-exclusion to anonymous access types
When analyzing an array or record type declaration whose component has a constrained access type, e.g.: type Buffer_Acc is not null access all String; type Buffer_Rec is record Data : Buffer_Acc (1 .. 10); end record; type Buffer_Arr is array (Boolean) of Buffer_Acc (1 .. 10); we propagated various properties of the unconstrained access type (e.g. the designated type, access-to-constant flag), but forgot to propagate the null-exclusion. For GNAT it didn't make a big difference, because the (anonymous) component type was never subject to legality checks. The "value tracking" optimisation machinery, which also deals with null values, only works for entire objects and doesn't care about components. However, GNATprove uses this flag when an access-to-component object is dereferenced. gcc/ada/ * sem_ch3.adb (Constrain_Access): Propagate null-exclusion flag from parent type.
Diffstat (limited to 'gcc/ada/init.c')
0 files changed, 0 insertions, 0 deletions