Sfoglia il codice sorgente

* allow a range of Low(Longint) to High(DWord) in TryStrToInt, see also issue #39406
* moved test

(cherry picked from commit 435f3a9fe2ff52fb4f3c49dce72d34798fa40121)

florian 3 anni fa
parent
commit
bbffe9e26a

+ 1 - 1
rtl/objpas/sysutils/sysstr.inc

@@ -962,7 +962,7 @@ var
   li : Int64;
   li : Int64;
 begin
 begin
   Val(s, li, Error);
   Val(s, li, Error);
-  TryStrToInt:=(Error=0) and (li<=High(Longint)) and (li>=Low(Longint));
+  TryStrToInt:=(Error=0) and (li<=High(DWord)) and (li>=Low(Longint));
   if TryStrToInt then
   if TryStrToInt then
     i:=li;
     i:=li;
 end;
 end;

+ 0 - 0
tests/webtbs/tw8177.pp → tests/test/units/sysutils/tstrtoint.pp