+ add a method to tdef to initialize the defid from within a constructor

git-svn-id: trunk@43624 -
This commit is contained in:
svenbarth 2019-12-02 06:58:47 +00:00
parent b8a78b135c
commit 80a4a01f12

View File

@ -55,6 +55,9 @@ interface
protected
{ whether this def is already registered in the unit's def list }
function registered : boolean;
{ initialize the defid field; only call from a constructor as it threats
0 as an invalid value! }
procedure init_defid;
public
typesym : tsym; { which type the definition was generated this def }
{ stabs debugging }
@ -273,6 +276,13 @@ implementation
end;
procedure tdef.init_defid;
begin
if defid=0 then
defid:=defid_not_registered;
end;
constructor tdef.create(dt:tdeftyp);
begin
inherited create;
@ -282,7 +292,7 @@ implementation
defoptions:=[];
dbg_state:=dbg_state_unused;
stab_number:=0;
defid:=defid_not_registered;
init_defid;
end;