mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-26 14:50:32 +02:00
* 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:
parent
a28a9a9521
commit
74e721517d
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -12178,6 +12178,7 @@ tests/webtbs/tw21073.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw2109.pp svneol=native#text/plain
|
tests/webtbs/tw2109.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2110.pp svneol=native#text/plain
|
tests/webtbs/tw2110.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw21146.pp svneol=native#text/pascal
|
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/tw2128.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2129.pp svneol=native#text/plain
|
tests/webtbs/tw2129.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2129b.pp svneol=native#text/plain
|
tests/webtbs/tw2129b.pp svneol=native#text/plain
|
||||||
|
@ -313,7 +313,7 @@ implementation
|
|||||||
constwstring :
|
constwstring :
|
||||||
p1:=cstringconstnode.createwstr(pcompilerwidestring(p.value.valueptr));
|
p1:=cstringconstnode.createwstr(pcompilerwidestring(p.value.valueptr));
|
||||||
constreal :
|
constreal :
|
||||||
p1:=crealconstnode.create(pbestreal(p.value.valueptr)^,pbestrealtype^);
|
p1:=crealconstnode.create(pbestreal(p.value.valueptr)^,p.constdef);
|
||||||
constset :
|
constset :
|
||||||
p1:=csetconstnode.create(pconstset(p.value.valueptr),p.constdef);
|
p1:=csetconstnode.create(pconstset(p.value.valueptr),p.constdef);
|
||||||
constpointer :
|
constpointer :
|
||||||
|
@ -43,7 +43,7 @@ type
|
|||||||
{$endif Test_Double_checksum}
|
{$endif Test_Double_checksum}
|
||||||
|
|
||||||
const
|
const
|
||||||
CurrentPPUVersion = 143;
|
CurrentPPUVersion = 144;
|
||||||
|
|
||||||
{ buffer sizes }
|
{ buffer sizes }
|
||||||
maxentrysize = 1024;
|
maxentrysize = 1024;
|
||||||
|
@ -1816,6 +1816,7 @@ implementation
|
|||||||
end;
|
end;
|
||||||
constreal :
|
constreal :
|
||||||
begin
|
begin
|
||||||
|
ppufile.getderef(constdefderef);
|
||||||
new(pd);
|
new(pd);
|
||||||
pd^:=ppufile.getreal;
|
pd^:=ppufile.getreal;
|
||||||
value.valueptr:=pd;
|
value.valueptr:=pd;
|
||||||
@ -1860,14 +1861,14 @@ implementation
|
|||||||
|
|
||||||
procedure tconstsym.buildderef;
|
procedure tconstsym.buildderef;
|
||||||
begin
|
begin
|
||||||
if consttyp in [constord,constpointer,constset] then
|
if consttyp in [constord,constreal,constpointer,constset] then
|
||||||
constdefderef.build(constdef);
|
constdefderef.build(constdef);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure tconstsym.deref;
|
procedure tconstsym.deref;
|
||||||
begin
|
begin
|
||||||
if consttyp in [constord,constpointer,constset] then
|
if consttyp in [constord,constreal,constpointer,constset] then
|
||||||
constdef:=tdef(constdefderef.resolve);
|
constdef:=tdef(constdefderef.resolve);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1900,7 +1901,10 @@ implementation
|
|||||||
ppufile.putdata(pchar(value.valueptr)^,value.len);
|
ppufile.putdata(pchar(value.valueptr)^,value.len);
|
||||||
end;
|
end;
|
||||||
constreal :
|
constreal :
|
||||||
ppufile.putreal(pbestreal(value.valueptr)^);
|
begin
|
||||||
|
ppufile.putderef(constdefderef);
|
||||||
|
ppufile.putreal(pbestreal(value.valueptr)^);
|
||||||
|
end;
|
||||||
constset :
|
constset :
|
||||||
begin
|
begin
|
||||||
ppufile.putderef(constdefderef);
|
ppufile.putderef(constdefderef);
|
||||||
|
6
tests/webtbs/tw21151.pp
Normal file
6
tests/webtbs/tw21151.pp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
const
|
||||||
|
cs = single(0.05);
|
||||||
|
begin
|
||||||
|
if sizeof(cs)<>4 then
|
||||||
|
halt(1);
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user