This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Large timeout in delay until causes Time_Error


This patch protects Delay_Operations.To_Duration against overflow caused by the
conversion of very distant dates (end of time) to Unix duration equivalent.
Routine To_Duration is used in conjunction with "delay until" statements.

Tested on x86_64-pc-linux-gnu, committed on trunk

2009-04-15  Hristian Kirtchev  <kirtchev@adacore.com>

	* a-calend.adb: Move constant Epoch_Offset from package
	Conversion_Operations to top level.
	(Delay_Operations.To_Duration): Define a constant which represents
	"end of time" and use it as a guard against very distant delay dates.
	Protect the code against overflow when performing the origin shift to
	Unix time.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]