From 02fbf97a1e4015b760d05db00501288b39bdbc4d Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Sat, 22 Jan 2022 18:22:37 -0600 Subject: [PATCH] Work around the SANE comp conversion bug in another place. This affects casts to comp evaluated at compile time, e.g.: static comp c = (comp)-53019223785472.0; --- CGI.pas | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/CGI.pas b/CGI.pas index cc2fccf..666f0d3 100644 --- a/CGI.pas +++ b/CGI.pas @@ -1413,10 +1413,15 @@ case tp of d := rval; rval := d; end; - cgComp: begin - c := rval; - rval := c; - end; + cgComp: if rval < 0.0 then begin + {work around SANE comp conversion bug} + c := -rval; + rval := -c; + end {if} + else begin + c := rval; + rval := c; + end; {else} cgExtended: ; end; {case} end; {LimitPrecision}