Skip to content

Commit

Permalink
THRIFT-4642 FPU ctrl word settings may cause an unexpected "denormali…
Browse files Browse the repository at this point in the history
…zed" error

Client: Delphi
Patch: Jens Geyer
  • Loading branch information
Jens-G committed Sep 24, 2018
1 parent ce70ba2 commit a923580
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions lib/delphi/src/Thrift.Protocol.Compact.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1088,11 +1088,29 @@ procedure TestLongBytes;
{$ENDIF}


{$IFDEF Debug}
procedure UnitTest;
var w : WORD;
const FPU_CW_DENORMALIZED = $0002;
begin
w := Get8087CW;
try
Set8087CW( w or FPU_CW_DENORMALIZED);

TestDoubleToInt64Bits;
TestZigZag;
TestLongBytes;

finally
Set8087CW( w);
end;
end;
{$ENDIF}


initialization
{$IFDEF Debug}
TestDoubleToInt64Bits;
TestZigZag;
TestLongBytes;
UnitTest;
{$ENDIF}

end.
Expand Down

0 comments on commit a923580

Please sign in to comment.