ソースを参照

* Fix bug ID #26512

git-svn-id: trunk@30620 -
michael 10 年 前
コミット
3b33b2a7bc
1 ファイル変更2 行追加0 行削除
  1. 2 0
      rtl/objpas/sysutils/dati.inc

+ 2 - 0
rtl/objpas/sysutils/dati.inc

@@ -164,6 +164,8 @@ begin
       Date:=Date+1/(msecsperday*2)
       Date:=Date+1/(msecsperday*2)
     else  
     else  
       Date:=Date-1/(msecsperday*2);
       Date:=Date-1/(msecsperday*2);
+    if Date>MaxDateTime then
+       Raise EConvertError.CreateFmt('%f is not a valid TDatetime encoding, maximum value is %f.',[Date,MaxDateTime]);
     j := pred((Trunc(System.Int(Date)) + 693900) SHL 2);
     j := pred((Trunc(System.Int(Date)) + 693900) SHL 2);
     ly:= j DIV 146097;
     ly:= j DIV 146097;
     j:= j - 146097 * cardinal(ly);
     j:= j - 146097 * cardinal(ly);