diff options
author | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2015-01-21 23:28:34 +0000 |
---|---|---|
committer | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2015-01-21 23:28:34 +0000 |
commit | 1903b037de2fb3e75826406b46f055acb70963fa (patch) | |
tree | 604cd8b790fe14e5fbe441d4cd647c80d2a36a9a /compiler/ngenutil.pas | |
parent | ad1141d52f8353457053b925cd674fe1d5c4eafc (diff) | |
parent | 953d907e4d6c3a5c2f8aaee6e5e4f73c55ce5985 (diff) | |
download | fpc-blocks.tar.gz |
* synchronised with trunk till r29513blocks
git-svn-id: http://svn.freepascal.org/svn/fpc/branches/blocks@29516 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/ngenutil.pas')
-rw-r--r-- | compiler/ngenutil.pas | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/compiler/ngenutil.pas b/compiler/ngenutil.pas index 1811029fb1..6b5a4169fd 100644 --- a/compiler/ngenutil.pas +++ b/compiler/ngenutil.pas @@ -605,9 +605,14 @@ implementation StructList: TFPList absolute arg; begin if (tdef(p).typ in [objectdef,recorddef]) and - not (df_generic in tdef(p).defoptions) and - ([oo_has_class_constructor,oo_has_class_destructor] * tabstractrecorddef(p).objectoptions <> []) then - StructList.Add(p); + not (df_generic in tdef(p).defoptions) then + begin + { first add the class... } + if ([oo_has_class_constructor,oo_has_class_destructor] * tabstractrecorddef(p).objectoptions <> []) then + StructList.Add(p); + { ... and then also add all subclasses } + tabstractrecorddef(p).symtable.deflist.foreachcall(@AddToStructInits,arg); + end; end; @@ -908,7 +913,7 @@ implementation begin if (target_res.id in [res_elf,res_macho,res_xcoff]) then begin - ResourceInfo:=TAsmList.Create; + ResourceInfo:=current_asmdata.asmlists[al_globals]; maybe_new_object_file(ResourceInfo); new_section(ResourceInfo,sec_data,'FPC_RESLOCATION',sizeof(aint)); @@ -923,9 +928,6 @@ implementation {$ELSE} ResourceInfo.Concat(Tai_const.Create_64bit(0)); {$ENDIF} - maybe_new_object_file(current_asmdata.asmlists[al_globals]); - current_asmdata.asmlists[al_globals].concatlist(ResourceInfo); - ResourceInfo.free; end; end; |