* fixed internalerror(2007120903) when using -Cfsse2 in case an unsigned

32 bit subrange type with high(subrange_type) <= high(longint) is
    converted to a float

git-svn-id: trunk@13037 -
This commit is contained in:
Jonas Maebe 2009-04-25 11:40:02 +00:00
parent 533f533868
commit dbeb3e060f
3 changed files with 26 additions and 3 deletions

1
.gitattributes vendored
View File

@ -7240,6 +7240,7 @@ tests/tbs/tb0554.pp svneol=native#text/plain
tests/tbs/tb0555.pp svneol=native#text/plain
tests/tbs/tb0556.pp svneol=native#text/plain
tests/tbs/tb0557.pp svneol=native#text/plain
tests/tbs/tb0558.pp svneol=native#text/plain
tests/tbs/tb205.pp svneol=native#text/plain
tests/tbs/ub0060.pp svneol=native#text/plain
tests/tbs/ub0069.pp svneol=native#text/plain

View File

@ -262,10 +262,13 @@ implementation
else
internalerror(2007120902);
end;
case left.location.size of
OS_S32:
{ don't use left.location.size, because that one may be OS_32/OS_64
if the lower bound of the orddef >= 0
}
case torddef(left.resultdef).ordtype of
s32bit:
opsize:=S_L;
OS_S64:
s64bit:
opsize:=S_Q;
else
internalerror(2007120903);

19
tests/tbs/tb0558.pp Normal file
View File

@ -0,0 +1,19 @@
{ %cpu=i386}
{ %opt=-Cfsse2 }
{$mode objfpc}
type
TChartZPosition = 0..MaxInt;
TDoublePoint = record x, y: double; end;
var
d: double;
z: TChartZPosition;
begin
d:=5.0;
z:=3;
d:=d-z;
if (d<>2.0) then
halt(1);
end.