From 80a4a01f12de35c02a443d59af55d7ab75da6e88 Mon Sep 17 00:00:00 2001 From: svenbarth Date: Mon, 2 Dec 2019 06:58:47 +0000 Subject: [PATCH] + add a method to tdef to initialize the defid from within a constructor git-svn-id: trunk@43624 - --- compiler/symtype.pas | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/compiler/symtype.pas b/compiler/symtype.pas index a2fd73cb7c..8d90f4c3bd 100644 --- a/compiler/symtype.pas +++ b/compiler/symtype.pas @@ -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;