* don't ever mark the function result as vs_initialised, also not when

it is passed as a hidden parameter (mantis #20907)

git-svn-id: trunk@20373 -
This commit is contained in:
Jonas Maebe 2012-02-17 16:25:50 +00:00
parent b31c15fbcc
commit bacdd8be81
4 changed files with 31 additions and 1 deletions

2
.gitattributes vendored
View File

@ -11287,6 +11287,8 @@ tests/webtbf/tw2070.pp svneol=native#text/plain
tests/webtbf/tw20721a.pp svneol=native#text/pascal
tests/webtbf/tw20721b.pp svneol=native#text/pascal
tests/webtbf/tw20721c.pp svneol=native#text/pascal
tests/webtbf/tw20907.pp svneol=native#text/plain
tests/webtbf/tw20907a.pp svneol=native#text/plain
tests/webtbf/tw21087.pp svneol=native#text/plain
tests/webtbf/tw2128.pp svneol=native#text/plain
tests/webtbf/tw2129.pp svneol=native#text/plain

View File

@ -1522,7 +1522,8 @@ implementation
constructor tparavarsym.create(const n : string;nr:word;vsp:tvarspez;def:tdef;vopts:tvaroptions);
begin
inherited create(paravarsym,n,vsp,def,vopts);
if (vsp in [vs_var,vs_value,vs_const,vs_constref]) then
if (vsp in [vs_var,vs_value,vs_const,vs_constref]) and
not(vo_is_funcret in vopts) then
varstate := vs_initialised;
paranr:=nr;
paraloc[calleeside].init;

16
tests/webtbf/tw20907.pp Normal file
View File

@ -0,0 +1,16 @@
{ %opt=-vew -Sew }
{ %fail }
type
trec = record
s: set of byte;
end;
function f: trec;
begin
if f.s <>[] then ;
end;
begin
f;
end.

11
tests/webtbf/tw20907a.pp Normal file
View File

@ -0,0 +1,11 @@
{ %opt=-vw -Sew }
{ %fail }
function f: ansistring;
begin
if f <> '' then;
end;
begin
f;
end.