* keep track of the type of symbolic floating point constants rather

than always forcing them to bestreal (mantis #21151)

git-svn-id: trunk@20190 -
This commit is contained in:
Jonas Maebe 2012-01-28 18:38:06 +00:00
parent a28a9a9521
commit 74e721517d
5 changed files with 16 additions and 5 deletions

1
.gitattributes vendored
View File

@ -12178,6 +12178,7 @@ tests/webtbs/tw21073.pp svneol=native#text/plain
tests/webtbs/tw2109.pp svneol=native#text/plain
tests/webtbs/tw2110.pp svneol=native#text/plain
tests/webtbs/tw21146.pp svneol=native#text/pascal
tests/webtbs/tw21151.pp svneol=native#text/plain
tests/webtbs/tw2128.pp svneol=native#text/plain
tests/webtbs/tw2129.pp svneol=native#text/plain
tests/webtbs/tw2129b.pp svneol=native#text/plain

View File

@ -313,7 +313,7 @@ implementation
constwstring :
p1:=cstringconstnode.createwstr(pcompilerwidestring(p.value.valueptr));
constreal :
p1:=crealconstnode.create(pbestreal(p.value.valueptr)^,pbestrealtype^);
p1:=crealconstnode.create(pbestreal(p.value.valueptr)^,p.constdef);
constset :
p1:=csetconstnode.create(pconstset(p.value.valueptr),p.constdef);
constpointer :

View File

@ -43,7 +43,7 @@ type
{$endif Test_Double_checksum}
const
CurrentPPUVersion = 143;
CurrentPPUVersion = 144;
{ buffer sizes }
maxentrysize = 1024;

View File

@ -1816,6 +1816,7 @@ implementation
end;
constreal :
begin
ppufile.getderef(constdefderef);
new(pd);
pd^:=ppufile.getreal;
value.valueptr:=pd;
@ -1860,14 +1861,14 @@ implementation
procedure tconstsym.buildderef;
begin
if consttyp in [constord,constpointer,constset] then
if consttyp in [constord,constreal,constpointer,constset] then
constdefderef.build(constdef);
end;
procedure tconstsym.deref;
begin
if consttyp in [constord,constpointer,constset] then
if consttyp in [constord,constreal,constpointer,constset] then
constdef:=tdef(constdefderef.resolve);
end;
@ -1900,7 +1901,10 @@ implementation
ppufile.putdata(pchar(value.valueptr)^,value.len);
end;
constreal :
ppufile.putreal(pbestreal(value.valueptr)^);
begin
ppufile.putderef(constdefderef);
ppufile.putreal(pbestreal(value.valueptr)^);
end;
constset :
begin
ppufile.putderef(constdefderef);

6
tests/webtbs/tw21151.pp Normal file
View File

@ -0,0 +1,6 @@
const
cs = single(0.05);
begin
if sizeof(cs)<>4 then
halt(1);
end.