mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 11:09:42 +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/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
|
||||
|
@ -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 :
|
||||
|
@ -43,7 +43,7 @@ type
|
||||
{$endif Test_Double_checksum}
|
||||
|
||||
const
|
||||
CurrentPPUVersion = 143;
|
||||
CurrentPPUVersion = 144;
|
||||
|
||||
{ buffer sizes }
|
||||
maxentrysize = 1024;
|
||||
|
@ -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
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