mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-19 18:59:27 +01:00
* 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:
parent
b31c15fbcc
commit
bacdd8be81
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -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
|
||||
|
||||
@ -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
16
tests/webtbf/tw20907.pp
Normal 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
11
tests/webtbf/tw20907a.pp
Normal file
@ -0,0 +1,11 @@
|
||||
{ %opt=-vw -Sew }
|
||||
{ %fail }
|
||||
|
||||
function f: ansistring;
|
||||
begin
|
||||
if f <> '' then;
|
||||
end;
|
||||
|
||||
begin
|
||||
f;
|
||||
end.
|
||||
Loading…
Reference in New Issue
Block a user