diff options
Diffstat (limited to 'gcc/ada/namet.adb')
-rw-r--r-- | gcc/ada/namet.adb | 8 |
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 |