* don't try to bitpack arrays of non-ordinals (mantis #36157)

git-svn-id: trunk@43187 -
This commit is contained in:
Jonas Maebe 2019-10-13 11:11:28 +00:00
parent 51c6ebfe54
commit 33c4a5dda7
3 changed files with 19 additions and 0 deletions

1
.gitattributes vendored
View File

@ -17841,6 +17841,7 @@ tests/webtbs/tw35982.pp svneol=native#text/pascal
tests/webtbs/tw36013.pp svneol=native#text/pascal
tests/webtbs/tw3612.pp svneol=native#text/plain
tests/webtbs/tw36156.pp svneol=native#text/plain
tests/webtbs/tw36157.pp svneol=native#text/plain
tests/webtbs/tw3617.pp svneol=native#text/plain
tests/webtbs/tw3619.pp svneol=native#text/plain
tests/webtbs/tw3621.pp svneol=native#text/plain

View File

@ -1250,6 +1250,7 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
end
{ packed array constant }
else if is_packed_array(def) and
(def.elementdef.typ in [orddef,enumdef]) and
((def.elepackedbitsize mod 8 <> 0) or
not ispowerof2(def.elepackedbitsize div 8,i)) then
begin

17
tests/webtbs/tw36157.pp Normal file
View File

@ -0,0 +1,17 @@
program WatchesValuePrg;
type
TEnum = (EnVal1, EnVal2, EnVal3, EnVal4);
TSet = set of TEnum;
TBitPackSetArray2 = bitpacked array [0..1, 0..2] of TSet;
const
gcBitPackSetArray2 : TBitPackSetArray2 = (([EnVal3, EnVal1], [], [EnVal3]), ([],[EnVal1,EnVal2],[EnVal1]));
begin
if gcBitPackSetArray2[0,0]<>[EnVal3, EnVal1] then
halt(1);
if gcBitPackSetArray2[0,2]<>[EnVal3] then
halt(2);
if gcBitPackSetArray2[1,1]<>[EnVal1,EnVal2] then
halt(3);
end.