From 71affc54b59a7026571ee5d8dad000bd6e0c760c Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Tue, 21 Jan 2014 17:33:09 +0100 Subject: [multiple changes] 2014-01-21 Robert Dewar * par-ch4.adb (P_If_Expression): Rewritten to improve error recovery. * par-ch5.adb (P_Condition): New version with expression prescanned. * par.adb (P_Condition): New version with expression prescanned. 2014-01-21 Robert Dewar * gnat_rm.texi: Document that Allow_Integer_Address is ignored if Address is not a private type. * sem_prag.adb (Analyze_Pragma, case Allow_Integer_Address): Ignore pragma if System.Address is not a private type. 2014-01-21 Arnaud Charlet * namet.ads (Name_Len): Initialize to 0 to avoid accessing an uninitialized value. From-SVN: r206892 --- gcc/ada/namet.ads | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gcc/ada/namet.ads') diff --git a/gcc/ada/namet.ads b/gcc/ada/namet.ads index dcce9ea..4c9fc77 100644 --- a/gcc/ada/namet.ads +++ b/gcc/ada/namet.ads @@ -130,9 +130,15 @@ package Namet is -- The limit here is intended to be an infinite value that ensures that we -- never overflow the buffer (names this long are too absurd to worry!) - Name_Len : Natural; + Name_Len : Natural := 0; -- Length of name stored in Name_Buffer. Used as an input parameter for -- Name_Find, and as an output value by Get_Name_String, or Write_Name. + -- Note: in normal usage, all users of Name_Buffer/Name_Len are expected + -- to initialize Name_Len appropriately. The reason we preinitialize to + -- zero here is that some circuitry (e.g. Osint.Write_Program_Name) does + -- a save/restore on Name_Len and Name_Buffer (1 .. Name_Len), and we do + -- not want some arbitrary junk value to result in saving an arbitrarily + -- long slice which would waste time and blow the stack. ----------------------------- -- Types for Namet Package -- -- cgit v1.1