* do not throw an internal error on typed constants with wrong element count, resolves #40066

This commit is contained in:
florian 2022-12-30 21:52:24 +01:00
parent 5fb88cef00
commit 7affd78904
2 changed files with 15 additions and 2 deletions

View File

@ -1804,7 +1804,7 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
) then
Message1(parser_w_skipped_fields_after,sorg);
if not error then
if ErrorCount=0 then
begin
if not(is_packed) then
fillbytes:=0
@ -1816,9 +1816,10 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
end;
for i:=1 to fillbytes do
ftcb.emit_tai(Tai_const.Create_8bit(0),u8inttype);
ftcb.maybe_end_aggregate(def);
end;
ftcb.maybe_end_aggregate(def);
consume(_RKLAMMER);
end;

12
tests/webtbf/tw40066.pp Normal file
View File

@ -0,0 +1,12 @@
{ %fail }
const
Outer: array[0 .. 1] of record
inner: array[0 .. 1] of uint32;
end =
(
(inner: ()),
(inner: (1))
);
begin
end.