aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/namet.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2017-01-23 12:57:27 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2017-01-23 12:57:27 +0100
commita77152ca855e6009a38ee011043465d60ed8f5c2 (patch)
tree7a999150817148c9dce5567eadcda89f817965fd /gcc/ada/namet.adb
parentd43584ca123f03c24aa7e59a43ecf2bd3a6e4863 (diff)
downloadgcc-a77152ca855e6009a38ee011043465d60ed8f5c2.zip
gcc-a77152ca855e6009a38ee011043465d60ed8f5c2.tar.gz
gcc-a77152ca855e6009a38ee011043465d60ed8f5c2.tar.bz2
[multiple changes]
2017-01-23 Yannick Moy <moy@adacore.com> * frontend.adb (Frontend): Do not load runtime unit for GNATprove when parsing failed. * exp_ch9.adb: minor removal of extra whitespace * exp_ch6.adb: minor typo in comment * sem_util.adb: Code cleanup. * exp_ch9.ads, par-ch2.adb: minor style fixes in whitespace and comment * a-ngcefu.adb: minor style fix in whitespace 2017-01-23 Thomas Quinot <quinot@adacore.com> * scos.ads: Document usage of 'd' as default SCO kind for declarations. * par_sco.adb (Traverse_Declarations_Or_Statements. Traverse_Degenerate_Subprogram): New supporting routine for expression functions and null procedures. (Traverse_Declarations_Or_Statements.Traverse_One): Add N_Expression_Function to the subprogram case; add required support for null procedures and expression functions. 2017-01-23 Bob Duff <duff@adacore.com> * namet.ads (Bounded_String): Decrease the size of type Bounded_String to avoid running out of stack space. * namet.ads (Append): Don't ignore buffer overflow; raise Program_Error instead. From-SVN: r244789
Diffstat (limited to 'gcc/ada/namet.adb')
-rw-r--r--gcc/ada/namet.adb8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/ada/namet.adb b/gcc/ada/namet.adb
index 1fdc37c..5bea77d 100644
--- a/gcc/ada/namet.adb
+++ b/gcc/ada/namet.adb
@@ -115,10 +115,12 @@ package body Namet is
procedure Append (Buf : in out Bounded_String; C : Character) is
begin
- if Buf.Length < Buf.Chars'Last then
- Buf.Length := Buf.Length + 1;
- Buf.Chars (Buf.Length) := C;
+ if Buf.Length >= Buf.Chars'Last then
+ raise Program_Error;
end if;
+
+ Buf.Length := Buf.Length + 1;
+ Buf.Chars (Buf.Length) := C;
end Append;
procedure Append (Buf : in out Bounded_String; V : Nat) is