From 6f7777c99483cdc10d5eafe7bd47e752a34f862a Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 20 Jun 2019 19:01:57 +0200 Subject: errorout-memory: avoid a crash after the limit is --- src/errorout-memory.adb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/errorout-memory.adb') diff --git a/src/errorout-memory.adb b/src/errorout-memory.adb index c0e6cd1df..a13e5c668 100644 --- a/src/errorout-memory.adb +++ b/src/errorout-memory.adb @@ -115,7 +115,10 @@ package body Errorout.Memory is pragma Assert (Group /= Msg_Single); case Errors.Table (Errors.Last).Header.Group is when Msg_Single | Msg_Last => - raise Internal_Error; + -- Check consistency until messages are discarded. + if Nbr_Errors <= Max_Nbr_Errors then + raise Internal_Error; + end if; when Msg_Main => Errors.Table (Errors.Last).Header.Group := Msg_Single; when Msg_Related => -- cgit v1.2.3