From e0ece4a694de1b31cb71f17e8d7178dab9c15893 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 14 Jul 2017 07:47:21 +0200 Subject: Detect wait timeout overflow. Fix #382 --- src/grt/grt-processes.adb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/grt/grt-processes.adb b/src/grt/grt-processes.adb index 208a99b18..6c6e959d7 100644 --- a/src/grt/grt-processes.adb +++ b/src/grt/grt-processes.adb @@ -524,9 +524,14 @@ package body Grt.Processes is -- LRM93 8.1 Error ("negative timeout clause"); end if; - Proc.Timeout := Current_Time + Time; Proc.State := State_Delayed; - Update_Process_First_Timeout (Proc); + if Time <= Std_Time'Last - Current_Time then + Proc.Timeout := Current_Time + Time; + Update_Process_First_Timeout (Proc); + else + -- Delay past the end of the times. + Proc.Timeout := Std_Time'Last; + end if; end Ghdl_Process_Wait_Timeout; -- Verilog. -- cgit v1.2.3