diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-01-21 17:33:09 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-01-21 17:33:09 +0100 |
commit | 71affc54b59a7026571ee5d8dad000bd6e0c760c (patch) | |
tree | f6613c9cb7abf86dd60c46c21622ad75ef34fe4b /gcc/ada/namet.ads | |
parent | ef1c051102dd6c40fc8dbaf9ab8d87b06b47b8d0 (diff) | |
download | gcc-71affc54b59a7026571ee5d8dad000bd6e0c760c.zip gcc-71affc54b59a7026571ee5d8dad000bd6e0c760c.tar.gz gcc-71affc54b59a7026571ee5d8dad000bd6e0c760c.tar.bz2 |
[multiple changes]
2014-01-21 Robert Dewar <dewar@adacore.com>
* 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 <dewar@adacore.com>
* 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 <charlet@adacore.com>
* namet.ads (Name_Len): Initialize to 0 to avoid accessing an
uninitialized value.
From-SVN: r206892
Diffstat (limited to 'gcc/ada/namet.ads')
-rw-r--r-- | gcc/ada/namet.ads | 8 |
1 files changed, 7 insertions, 1 deletions
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 -- |