This is an automated email from the ASF dual-hosted git repository.

jensg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git


The following commit(s) were added to refs/heads/master by this push:
     new a923580  THRIFT-4642 FPU ctrl word settings may cause an unexpected 
"denormalized" error Client: Delphi Patch: Jens Geyer
a923580 is described below

commit a9235805469bff4c15bdd939240edb7eb9aec34f
Author: Jens Geyer <[email protected]>
AuthorDate: Tue Sep 25 00:21:12 2018 +0200

    THRIFT-4642 FPU ctrl word settings may cause an unexpected "denormalized" 
error
    Client: Delphi
    Patch: Jens Geyer
---
 lib/delphi/src/Thrift.Protocol.Compact.pas | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/lib/delphi/src/Thrift.Protocol.Compact.pas 
b/lib/delphi/src/Thrift.Protocol.Compact.pas
index 5b1253a..1c1b3da 100644
--- a/lib/delphi/src/Thrift.Protocol.Compact.pas
+++ b/lib/delphi/src/Thrift.Protocol.Compact.pas
@@ -1088,11 +1088,29 @@ end;
 {$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.

Reply via email to