diff mbox

[Ada] Uninitialized variable on illegal placement of aspect specification

Message ID 20151020105632.GA51459@adacore.com
State New
Headers show

Commit Message

Arnaud Charlet Oct. 20, 2015, 10:56 a.m. UTC
This patch improves the handling of programs with illegal placement of
aspect specifications, ensuring that the flag that controls the parsing of
a list of declarations is properly set in the presence of errors.

No simple test available.

Tested on x86_64-pc-linux-gnu, committed on trunk

2015-10-20  Ed Schonberg  <schonberg@adacore.com>

	* par-ch3.adb (P_Declarative_Items): In case of misplaced
	aspect specifications, ensure that flag Done is properly set to
	continue parse.
diff mbox

Patch

Index: par-ch3.adb
===================================================================
--- par-ch3.adb	(revision 229023)
+++ par-ch3.adb	(working copy)
@@ -4425,6 +4425,12 @@ 
 
                else
                   Error_Msg_SC ("aspect specifications not allowed here");
+
+                  --  Assume that this is a misplaced aspect specification
+                  --  within a declarative list. After discarding the
+                  --  misplaced aspects we can continue the scan.
+
+                  Done := False;
                end if;
 
                declare