mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-04 06:54:05 +02:00
* do not throw an internal error on typed constants with wrong element count, resolves #40066
This commit is contained in:
parent
5fb88cef00
commit
7affd78904
@ -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
12
tests/webtbf/tw40066.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user