mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 01:29:29 +02:00
* float operations can have an exception as a side effect, resolves #37398
git-svn-id: trunk@45824 -
This commit is contained in:
parent
dd6e6eb26a
commit
5da913de0e
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -18382,6 +18382,7 @@ tests/webtbs/tw37323.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw37339.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw37393.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw37397.pp svneol=native#text/plain
|
||||
tests/webtbs/tw37398.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw3742.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3751.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3758.pp svneol=native#text/plain
|
||||
|
@ -1427,7 +1427,9 @@ implementation
|
||||
((mhs_exceptions in pmhs_flags(arg)^) and
|
||||
((n.nodetype in [derefn,vecn,divn,slashn]) or
|
||||
((n.nodetype=subscriptn) and is_implicit_pointer_object_type(tsubscriptnode(n).left.resultdef)) or
|
||||
((n.nodetype in [addn,subn,muln,unaryminusn]) and (n.localswitches*[cs_check_overflow,cs_check_range]<>[]))
|
||||
((n.nodetype in [addn,subn,muln,unaryminusn]) and (n.localswitches*[cs_check_overflow,cs_check_range]<>[])) or
|
||||
{ float operations could throw an exception }
|
||||
((n.nodetype in [addn,subn,muln,slashn,unaryminusn,equaln,unequaln,gten,gtn,lten,ltn]) and is_real_or_cextended(tunarynode(n).left.resultdef))
|
||||
)
|
||||
) or
|
||||
((n.nodetype=loadn) and
|
||||
|
12
tests/webtbs/tw37398.pp
Normal file
12
tests/webtbs/tw37398.pp
Normal file
@ -0,0 +1,12 @@
|
||||
program testnan;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses math;
|
||||
var d: double;
|
||||
temp: Boolean;
|
||||
begin
|
||||
d := NaN;
|
||||
temp := IsNan(d) or (d = 0);
|
||||
writeln(temp);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user