diff --git a/compiler/ncgutil.pas b/compiler/ncgutil.pas index 519bf7f0cf..62fa75a173 100644 --- a/compiler/ncgutil.pas +++ b/compiler/ncgutil.pas @@ -1470,7 +1470,9 @@ implementation ) and not(vo_is_typed_const in tabstractvarsym(p).varoptions) and not(vo_is_external in tabstractvarsym(p).varoptions) and - is_managed_type(tabstractvarsym(p).vardef) then + (is_managed_type(tabstractvarsym(p).vardef) or + ((m_iso in current_settings.modeswitches) and (tabstractvarsym(p).vardef.typ=filedef)) + ) then begin OldAsmList:=current_asmdata.CurrAsmList; current_asmdata.CurrAsmList:=TAsmList(arg); diff --git a/compiler/pinline.pas b/compiler/pinline.pas index 6d24481c32..3bed11c591 100644 --- a/compiler/pinline.pas +++ b/compiler/pinline.pas @@ -312,7 +312,8 @@ implementation ccallnode.createintern('fpc_getmem',para))); { create call to fpc_initialize } - if is_managed_type(tpointerdef(p.resultdef).pointeddef) then + if is_managed_type(tpointerdef(p.resultdef).pointeddef) or + ((m_iso in current_settings.modeswitches) and (tpointerdef(p.resultdef).pointeddef.typ=filedef)) then addstatement(newstatement,initialize_data_node(cderefnode.create(ctemprefnode.create(temp)))); { copy the temp to the destination }