Fix for Mantis #30357.

Reset tstoredsymtable.init_final_check_done when a symbol is added or removed as otherwise property getters in a record *before* any managed field would trigger it, thus leading to the record being considered as "non-managed".

git-svn-id: trunk@34088 -
This commit is contained in:
svenbarth 2016-07-08 18:20:47 +00:00
parent 7a5bac9cd3
commit 54b6cacf36
3 changed files with 41 additions and 0 deletions

1
.gitattributes vendored
View File

@ -15127,6 +15127,7 @@ tests/webtbs/tw3023.pp svneol=native#text/plain
tests/webtbs/tw30240.pp svneol=native#text/plain
tests/webtbs/tw3028.pp svneol=native#text/plain
tests/webtbs/tw30329.pp -text svneol=native#text/plain
tests/webtbs/tw30357.pp svneol=native#text/pascal
tests/webtbs/tw3038.pp svneol=native#text/plain
tests/webtbs/tw3041.pp svneol=native#text/plain
tests/webtbs/tw3045.pp svneol=native#text/plain

View File

@ -453,12 +453,14 @@ implementation
procedure tstoredsymtable.insert(sym:TSymEntry;checkdup:boolean=true);
begin
inherited insert(sym,checkdup);
init_final_check_done:=false;
end;
procedure tstoredsymtable.delete(sym:TSymEntry);
begin
inherited delete(sym);
init_final_check_done:=false;
end;

38
tests/webtbs/tw30357.pp Normal file
View File

@ -0,0 +1,38 @@
program tw30357;
{$mode delphi}
type
TMyRecord = record
private
class function GetEmpty: TMyRecord; static;
public
class property Empty: TMyRecord read GetEmpty;
private
FData: IInterface;
end;
class function TMyRecord.GetEmpty: TMyRecord; static;
begin
end;
procedure Main2(Sender: TObject);
var
v1: PtrUInt;
begin
v1 := 42;
end;
procedure Main(Sender: TObject);
var
v1: TMyRecord;
begin
if v1.FData <> nil then
Halt(1);
end;
begin
{ with Main2 we ensure that the stack area is not 0 }
Main2(nil);
Main(nil);
end.