diff options
author | Arnaud Charlet <charlet@adacore.com> | 2019-12-18 07:16:17 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-12-18 07:16:17 +0000 |
commit | c7e3d0694bc09e8099542840f1a1f647c23a7222 (patch) | |
tree | 4fa9e9c9cb80d9a2bc16d259cf9517144e277558 /gcc/ada | |
parent | 19f0436b8facfbc75d938ebd6f88c68d8aea3a7e (diff) | |
download | gcc-c7e3d0694bc09e8099542840f1a1f647c23a7222.zip gcc-c7e3d0694bc09e8099542840f1a1f647c23a7222.tar.gz gcc-c7e3d0694bc09e8099542840f1a1f647c23a7222.tar.bz2 |
[Ada] Fix uninitialized out parameter in s-regpat.adb
2019-12-18 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* libgnat/s-regpat.adb (Parse_Literal, Parse_Piece): Ensure
Expr_Flags is always fully initialized.
From-SVN: r279517
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/libgnat/s-regpat.adb | 10 |
2 files changed, 9 insertions, 6 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 7573752..465f5a9 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,10 @@ 2019-12-18 Arnaud Charlet <charlet@adacore.com> + * libgnat/s-regpat.adb (Parse_Literal, Parse_Piece): Ensure + Expr_Flags is always fully initialized. + +2019-12-18 Arnaud Charlet <charlet@adacore.com> + * libgnat/s-atopar.ads, libgnat/s-atopex.ads (Atomic_Type): Can now be marked Atomic. This requires marking the unit Ada 202x. diff --git a/gcc/ada/libgnat/s-regpat.adb b/gcc/ada/libgnat/s-regpat.adb index d7f59c7..ae69f47 100644 --- a/gcc/ada/libgnat/s-regpat.adb +++ b/gcc/ada/libgnat/s-regpat.adb @@ -1558,7 +1558,8 @@ package body System.Regpat is Has_Special_Operator : Boolean := False; begin - Parse_Pos := Parse_Pos - 1; -- Look at current character + Expr_Flags := Worst_Expression; -- Ensure Expr_Flags is initialized + Parse_Pos := Parse_Pos - 1; -- Look at current character IP := Emit_Node @@ -1684,11 +1685,8 @@ package body System.Regpat is begin Parse_Atom (New_Flags, IP); - if IP = 0 then - return; - end if; - - if Parse_Pos > Parse_End + if IP = 0 + or else Parse_Pos > Parse_End or else not Is_Mult (Parse_Pos) then Expr_Flags := New_Flags; |