* constant floating point assignments etc. are now overflow checked

if Q+ or R+ is turned on
This commit is contained in:
florian 2004-08-08 16:00:56 +00:00
parent 6272064a5b
commit 120c165a62
3 changed files with 66 additions and 13 deletions

View File

@ -147,19 +147,52 @@ implementation
Consts.concat(Tai_label.Create(lastlabel)); Consts.concat(Tai_label.Create(lastlabel));
case realait of case realait of
ait_real_32bit : ait_real_32bit :
begin
Consts.concat(Tai_real_32bit.Create(ts32real(value_real))); Consts.concat(Tai_real_32bit.Create(ts32real(value_real)));
{ range checking? }
if ((cs_check_range in aktlocalswitches) or
(cs_check_overflow in aktlocalswitches)) and
(tai_real_32bit(Consts.Last).value=double(MathInf)) then
Message(parser_e_range_check_error);
end;
ait_real_64bit : ait_real_64bit :
begin
{$ifdef ARM} {$ifdef ARM}
if hiloswapped then if hiloswapped then
Consts.concat(Tai_real_64bit.Create_hiloswapped(ts64real(value_real))) Consts.concat(Tai_real_64bit.Create_hiloswapped(ts64real(value_real)))
else else
{$endif ARM} {$endif ARM}
Consts.concat(Tai_real_64bit.Create(ts64real(value_real))); Consts.concat(Tai_real_64bit.Create(ts64real(value_real)));
{ range checking? }
if ((cs_check_range in aktlocalswitches) or
(cs_check_overflow in aktlocalswitches)) and
(tai_real_64bit(Consts.Last).value=double(MathInf)) then
Message(parser_e_range_check_error);
end;
ait_real_80bit : ait_real_80bit :
begin
Consts.concat(Tai_real_80bit.Create(value_real)); Consts.concat(Tai_real_80bit.Create(value_real));
{ range checking? }
if ((cs_check_range in aktlocalswitches) or
(cs_check_overflow in aktlocalswitches)) and
(tai_real_80bit(Consts.Last).value=double(MathInf)) then
Message(parser_e_range_check_error);
end;
{$ifdef cpufloat128} {$ifdef cpufloat128}
ait_real_128bit : ait_real_128bit :
begin
Consts.concat(Tai_real_128bit.Create(value_real)); Consts.concat(Tai_real_128bit.Create(value_real));
{ range checking? }
if ((cs_check_range in aktlocalswitches) or
(cs_check_overflow in aktlocalswitches)) and
(tai_real_128bit(Consts.Last).value=double(MathInf)) then
Message(parser_e_range_check_error);
end;
{$endif cpufloat128} {$endif cpufloat128}
{$ifdef ver1_0} {$ifdef ver1_0}
@ -721,7 +754,11 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.44 2004-07-12 17:58:19 peter Revision 1.45 2004-08-08 16:00:56 florian
* constant floating point assignments etc. are now overflow checked
if Q+ or R+ is turned on
Revision 1.44 2004/07/12 17:58:19 peter
* remove maxlen field from ansistring/widestrings * remove maxlen field from ansistring/widestrings
Revision 1.43 2004/06/20 08:55:29 florian Revision 1.43 2004/06/20 08:55:29 florian

View File

@ -2450,7 +2450,11 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.151 2004-06-29 20:57:50 peter Revision 1.152 2004-08-08 16:00:56 florian
* constant floating point assignments etc. are now overflow checked
if Q+ or R+ is turned on
Revision 1.151 2004/06/29 20:57:50 peter
* fix pchar:=char * fix pchar:=char
* fix longint(smallset) * fix longint(smallset)

View File

@ -1365,6 +1365,14 @@ implementation
hp:=crealconstnode.create(exp(vr),pbestrealtype^) hp:=crealconstnode.create(exp(vr),pbestrealtype^)
else else
hp:=crealconstnode.create(exp(vl),pbestrealtype^); hp:=crealconstnode.create(exp(vl),pbestrealtype^);
if (trealconstnode(hp).value_real=double(MathInf)) and
((cs_check_range in aktlocalswitches) or
(cs_check_overflow in aktlocalswitches)) then
begin
result:=crealconstnode.create(0,pbestrealtype^);
CGMessage(parser_e_range_check_error);
end;
end; end;
in_const_ln : in_const_ln :
begin begin
@ -2433,7 +2441,11 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.141 2004-07-15 19:55:39 jonas Revision 1.142 2004-08-08 16:00:56 florian
* constant floating point assignments etc. are now overflow checked
if Q+ or R+ is turned on
Revision 1.141 2004/07/15 19:55:39 jonas
+ (incomplete) node_complexity function to assess the complexity of a + (incomplete) node_complexity function to assess the complexity of a
tree tree
+ support for inlining value and const parameters at the node level + support for inlining value and const parameters at the node level