* also initalize default helper variables of initialization sections, resolves #40183

This commit is contained in:
florian 2023-03-19 21:19:10 +01:00
parent 86ffe69380
commit 0d3ec87492
3 changed files with 30 additions and 0 deletions

View File

@ -424,6 +424,7 @@ implementation
{ The library init code is already called and does not
need to be in the initfinal table (PFV) }
block:=statement_block(_INITIALIZATION);
init_main_block_syms(block);
end
else if token=_FINALIZATION then
begin

5
tests/webtbs/tw40183.pp Normal file
View File

@ -0,0 +1,5 @@
uses
uw40183;
begin
end.

24
tests/webtbs/uw40183.pp Normal file
View File

@ -0,0 +1,24 @@
unit uw40183;
{$mode ObjFPC}{$H+}
interface
uses
Types;
type
TBuffer = packed record
Mask: Int64;
DataArray: TObjectDynArray;
end;
var
GlobalBuffer: TBuffer;
implementation
initialization
GlobalBuffer := Default(TBuffer);
end.