View Issue Details

IDProjectCategoryView StatusLast Update
0038390FPCCompilerpublic2021-01-24 15:58
ReporterIoulianos Kakoulidis Assigned ToSven Barth  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.2.0 
Fixed in Version3.3.1 
Summary0038390: UInt64 type helper Parse function returns wrong results
Descriptionprogram uint64parse;
{$MODE Delphi}
uses SysUtils;

var
  s: String;
  x: UInt64;

begin
  s := '20000000000';
  x := UInt64.Parse(s);
  WriteLn(x);
  UInt64.TryParse(s, x);
  WriteLn(x);
  x := StrToQWord(s);
  WriteLn(x);
end.

Output -
18446744072234715136
20000000000
20000000000
TagsNo tags attached.
Fixed in Revision48399
FPCOldBugId
FPCTarget-
Attached Files

Activities

Ioulianos Kakoulidis

2021-01-24 10:45

reporter   ~0128545

Output from -
program uint64parse;
{$MODE Delphi}
uses SysUtils;

var
  s: String;
  x: UInt64;

begin
  s := '20000000000';
  x := UInt64.Parse(s);
  WriteLn(x);
  UInt64.TryParse(s, x);
  WriteLn(x);
  x := StrToQWord(s);
  WriteLn(x);
  x := StrToUInt64(s);
  WriteLn(x);
end.

$ fpc -B uint64parse.pas
Free Pascal Compiler version 3.2.0 [2020/07/07] for x86_64
Copyright (c) 1993-2020 by Florian Klaempfl and others
Target OS: Win64 for x64
Compiling uint64parse.pas
Linking uint64parse.exe
19 lines compiled, 0.2 sec, 72768 bytes code, 5284 bytes data

$ ./uint64parse.exe
18446744072234715136
20000000000
20000000000
20000000000

Sven Barth

2021-01-24 15:58

manager   ~0128559

Please test and close if okay.

Issue History

Date Modified Username Field Change
2021-01-23 17:19 Ioulianos Kakoulidis New Issue
2021-01-24 10:45 Ioulianos Kakoulidis Note Added: 0128545
2021-01-24 14:08 Sven Barth Assigned To => Sven Barth
2021-01-24 14:08 Sven Barth Status new => assigned
2021-01-24 15:58 Sven Barth Status assigned => resolved
2021-01-24 15:58 Sven Barth Resolution open => fixed
2021-01-24 15:58 Sven Barth Fixed in Version => 3.3.1
2021-01-24 15:58 Sven Barth Fixed in Revision => 48399
2021-01-24 15:58 Sven Barth FPCTarget => -
2021-01-24 15:58 Sven Barth Note Added: 0128559