mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-24 11:10:09 +02:00
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:
parent
7a5bac9cd3
commit
54b6cacf36
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -15127,6 +15127,7 @@ tests/webtbs/tw3023.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw30240.pp svneol=native#text/plain
|
tests/webtbs/tw30240.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3028.pp svneol=native#text/plain
|
tests/webtbs/tw3028.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw30329.pp -text 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/tw3038.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3041.pp svneol=native#text/plain
|
tests/webtbs/tw3041.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3045.pp svneol=native#text/plain
|
tests/webtbs/tw3045.pp svneol=native#text/plain
|
||||||
|
@ -453,12 +453,14 @@ implementation
|
|||||||
procedure tstoredsymtable.insert(sym:TSymEntry;checkdup:boolean=true);
|
procedure tstoredsymtable.insert(sym:TSymEntry;checkdup:boolean=true);
|
||||||
begin
|
begin
|
||||||
inherited insert(sym,checkdup);
|
inherited insert(sym,checkdup);
|
||||||
|
init_final_check_done:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure tstoredsymtable.delete(sym:TSymEntry);
|
procedure tstoredsymtable.delete(sym:TSymEntry);
|
||||||
begin
|
begin
|
||||||
inherited delete(sym);
|
inherited delete(sym);
|
||||||
|
init_final_check_done:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
38
tests/webtbs/tw30357.pp
Normal file
38
tests/webtbs/tw30357.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user