mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 10:29:24 +02:00
* compiler crash fixed when constant arguments passed to round/trunc
exceeds the longint range
This commit is contained in:
parent
219dd5f0b5
commit
4ec3402851
@ -155,13 +155,29 @@ implementation
|
|||||||
case p^.inlinenumber of
|
case p^.inlinenumber of
|
||||||
in_const_trunc : begin
|
in_const_trunc : begin
|
||||||
if isreal then
|
if isreal then
|
||||||
hp:=genordinalconstnode(trunc(vr),s32bitdef)
|
begin
|
||||||
|
if (vr>=2147483648.0) or (vr<=-2147483649.0) then
|
||||||
|
begin
|
||||||
|
CGMessage(parser_e_range_check_error);
|
||||||
|
hp:=genordinalconstnode(1,s32bitdef)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
hp:=genordinalconstnode(trunc(vr),s32bitdef)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
hp:=genordinalconstnode(trunc(vl),s32bitdef);
|
hp:=genordinalconstnode(trunc(vl),s32bitdef);
|
||||||
end;
|
end;
|
||||||
in_const_round : begin
|
in_const_round : begin
|
||||||
if isreal then
|
if isreal then
|
||||||
hp:=genordinalconstnode(round(vr),s32bitdef)
|
begin
|
||||||
|
if (vr>=2147483647.5) or (vr<=-2147483648.5) then
|
||||||
|
begin
|
||||||
|
CGMessage(parser_e_range_check_error);
|
||||||
|
hp:=genordinalconstnode(1,s32bitdef)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
hp:=genordinalconstnode(round(vr),s32bitdef)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
hp:=genordinalconstnode(round(vl),s32bitdef);
|
hp:=genordinalconstnode(round(vl),s32bitdef);
|
||||||
end;
|
end;
|
||||||
@ -951,7 +967,11 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.16 1999-01-28 19:43:43 peter
|
Revision 1.17 1999-02-01 00:00:50 florian
|
||||||
|
* compiler crash fixed when constant arguments passed to round/trunc
|
||||||
|
exceeds the longint range
|
||||||
|
|
||||||
|
Revision 1.16 1999/01/28 19:43:43 peter
|
||||||
* fixed high generation for ansistrings with str,writeln
|
* fixed high generation for ansistrings with str,writeln
|
||||||
|
|
||||||
Revision 1.15 1999/01/27 16:28:22 pierre
|
Revision 1.15 1999/01/27 16:28:22 pierre
|
||||||
|
Loading…
Reference in New Issue
Block a user