mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 15:29:14 +02:00
* correctly handle result type of string constant nodes for internally created
nodes git-svn-id: trunk@45231 -
This commit is contained in:
parent
4e92f2651e
commit
b6097a0300
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -13274,6 +13274,7 @@ tests/tbs/tb0668a.pp svneol=native#text/pascal
|
|||||||
tests/tbs/tb0668b.pp svneol=native#text/pascal
|
tests/tbs/tb0668b.pp svneol=native#text/pascal
|
||||||
tests/tbs/tb0669.pp svneol=native#text/pascal
|
tests/tbs/tb0669.pp svneol=native#text/pascal
|
||||||
tests/tbs/tb0670.pp svneol=native#text/pascal
|
tests/tbs/tb0670.pp svneol=native#text/pascal
|
||||||
|
tests/tbs/tb0671.pp svneol=native#text/pascal
|
||||||
tests/tbs/ub0060.pp svneol=native#text/plain
|
tests/tbs/ub0060.pp svneol=native#text/plain
|
||||||
tests/tbs/ub0069.pp svneol=native#text/plain
|
tests/tbs/ub0069.pp svneol=native#text/plain
|
||||||
tests/tbs/ub0119.pp svneol=native#text/plain
|
tests/tbs/ub0119.pp svneol=native#text/plain
|
||||||
|
@ -2972,12 +2972,14 @@ implementation
|
|||||||
) then
|
) then
|
||||||
begin
|
begin
|
||||||
{ output string consts in local ansistring encoding }
|
{ output string consts in local ansistring encoding }
|
||||||
if is_ansistring(resultdef) and ((tstringdef(resultdef).encoding=0)or(tstringdef(resultdef).encoding=globals.CP_NONE)) then
|
if is_ansistring(resultdef) and
|
||||||
|
{ do not mess with the result type for internally created nodes }
|
||||||
|
not(nf_internal in flags) and
|
||||||
|
((tstringdef(resultdef).encoding=0) or (tstringdef(resultdef).encoding=globals.CP_NONE)) then
|
||||||
tstringconstnode(left).changestringtype(getansistringdef)
|
tstringconstnode(left).changestringtype(getansistringdef)
|
||||||
else
|
else
|
||||||
tstringconstnode(left).changestringtype(resultdef);
|
tstringconstnode(left).changestringtype(resultdef);
|
||||||
result:=left;
|
result:=left;
|
||||||
resultdef:=left.resultdef;
|
|
||||||
left:=nil;
|
left:=nil;
|
||||||
exit;
|
exit;
|
||||||
end
|
end
|
||||||
|
20
tests/tbs/tb0671.pp
Normal file
20
tests/tbs/tb0671.pp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{$inline on}
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
resourcestring
|
||||||
|
rs = 'All files';
|
||||||
|
|
||||||
|
function fs: string;inline;
|
||||||
|
begin
|
||||||
|
Result:='*';
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function f: String;
|
||||||
|
begin
|
||||||
|
Result:=rs+' ('+fs+')|'+fs;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
writeln(f);
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user