www/aws: Fix dispatcher-timer bug discovered by gcc5-aux

This commit is contained in:
John Marino 2015-03-16 19:01:40 +00:00
parent d0b0657655
commit a73f83276c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=381432
2 changed files with 38 additions and 1 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= aws
PORTVERSION= 3.2.0.0
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= www
MASTER_SITES= http://downloads.dragonlace.net/src/

View File

@ -0,0 +1,37 @@
--- src/extended/aws-services-dispatchers-timer.adb.orig 2014-05-15 19:48:07 UTC
+++ src/extended/aws-services-dispatchers-timer.adb
@@ -480,7 +480,11 @@ package body AWS.Services.Dispatchers.Ti
procedure Unregister
(Dispatcher : in out Handler;
- Name : String) is
+ Name : String)
+ is
+ use type Period_Table.Cursor;
+
+ Pos : Period_table.Cursor := Period_Table.No_Element;
begin
for Cursor in Dispatcher.Table.Iterate loop
declare
@@ -488,13 +492,18 @@ package body AWS.Services.Dispatchers.Ti
begin
if To_String (Item.Name) = Name then
Unchecked_Free (Item);
- Period_Table.Delete (Dispatcher.Table, Cursor);
- return;
+ Pos := Cursor;
+ exit;
end if;
end;
end loop;
- raise Constraint_Error with "Timer distpatcher " & Name & " not found";
+ if Pos = Period_Table.No_Element then
+ raise Constraint_Error
+ with "Timer distpatcher " & Name & " not found";
+ else
+ Period_Table.Delete (Dispatcher.Table, Pos);
+ end if;
end Unregister;
------------