diff options
author | Gary Dismukes <dismukes@adacore.com> | 2019-08-13 08:07:46 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-08-13 08:07:46 +0000 |
commit | 4167b0752365c69e5895b5c8097e7dba34f735f5 (patch) | |
tree | 79a7b5c51d8e2d1f6751067f639bbf77e5c3e909 /gcc/ada/inline.adb | |
parent | 6aaab5081f44b00b78e9550b5a33ba81f85c162c (diff) | |
download | gcc-4167b0752365c69e5895b5c8097e7dba34f735f5.zip gcc-4167b0752365c69e5895b5c8097e7dba34f735f5.tar.gz gcc-4167b0752365c69e5895b5c8097e7dba34f735f5.tar.bz2 |
[Ada] Compiler may blow up on array aggregates whose size is very large
The compiler may crash when compiling array aggregates where the
computation of the size produces a very large number that overflows
(possibly producing a small result), such as with an aggregate of a type
that is an array of arrays, where each array range has close to
Integer'Last elements. That can lead to Aggr_Size_OK returning
incorrectly returning True, following on to allocating a very large
array in function Flatten that blows the stack. The size computation
was being performed using type Int, so this was changed to use universal
arithmetic.
2019-08-13 Gary Dismukes <dismukes@adacore.com>
gcc/ada/
* exp_aggr.adb (Aggr_Size_OK): Compute the aggregate size using
universal arithmetic, to avoid situations where the size
computation overflows.
gcc/testsuite/
* gnat.dg/aggr26.adb: New testcase.
From-SVN: r274348
Diffstat (limited to 'gcc/ada/inline.adb')
0 files changed, 0 insertions, 0 deletions