aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch6.adb
diff options
context:
space:
mode:
authorSteve Baird <baird@adacore.com>2024-08-29 15:17:54 -0700
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-10-08 10:37:12 +0200
commit985b06da41a089ab5d1295177b90813d29032b72 (patch)
tree0ca015e40d641492c23ab1aa443f215d4202b2af /gcc/ada/sem_ch6.adb
parent65491166ddbc83b7283b42dc6d6451668acd9f22 (diff)
downloadgcc-985b06da41a089ab5d1295177b90813d29032b72.zip
gcc-985b06da41a089ab5d1295177b90813d29032b72.tar.gz
gcc-985b06da41a089ab5d1295177b90813d29032b72.tar.bz2
ada: Missing constraint check for 'Length attribute reference
In some cases involving a universal-integer-valued attribute reference (typically a 'Length attribute reference) occurring as an actual parameter in a call, the runtime check that the constraints of the formal parameter are satisfied is incorrectly not performed. gcc/ada/ChangeLog: * sem_attr.adb (Resolve_Attribute): When setting the Etype of a universal-integer-valued attribute reference to the subtype determined by its context, use the basetype of that subtype instead of the subtype itself if there is a possibility that the attribute value will not satisfy the constraints of that subtype. Otherwise the compiler is, in effect, assuming something that might not be true. Except use the subtype in the case of a not-from-source 'Pos attribute reference in order to avoid breaking things.
Diffstat (limited to 'gcc/ada/sem_ch6.adb')
0 files changed, 0 insertions, 0 deletions