summaryrefslogtreecommitdiffstats
path: root/lex.yy.c.shipped
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-12-22 07:20:30 -0800
committerKaz Kylheku <kaz@kylheku.com>2020-12-22 07:20:30 -0800
commit16017b64feb3a191d42c936e1bd0d483cdaf4f60 (patch)
treec4d2c72867274ec78fe80e27d036e3b6ce863163 /lex.yy.c.shipped
parent99d2eedbe9c1549c4ebd990e590d8a6a1c1ae588 (diff)
downloadtxr-16017b64feb3a191d42c936e1bd0d483cdaf4f60.tar.gz
txr-16017b64feb3a191d42c936e1bd0d483cdaf4f60.tar.bz2
txr-16017b64feb3a191d42c936e1bd0d483cdaf4f60.zip
int-flo: bugfix on 64 bit
* arith.c (int_flo): On 64 bit, we incorrectly handle the positive floating-point values which correspond to (expt 2 63) and (expt 2 64). This is because in the range check which detects whether a double value lands into the cnum or ucnum range, the 64 bit INT_PTR_MAX and UINT_PTR_MAX have no exact equivalent in the double type and are being converted to double values which are greater. That then causes the range check to incorrectly include double values that are actually out of range for the conversion to the cnum or ucnum type, causing bogus values. The quickest fix would be to use < comparison for a half-open range, but that sacrifices two double values on 32 bit, unnecessarily sending them to the text-based conversion code. So instead, let's subtract margins from the range constants on 64 bit.
Diffstat (limited to 'lex.yy.c.shipped')
0 files changed, 0 insertions, 0 deletions