From 25059eb03dfc52595ba1e68b9eded24ddc17eaec Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Fri, 22 Sep 2006 09:24:42 +0000 Subject: [PATCH] * only potentially change size of vecn results in case of packed arrays git-svn-id: trunk@4681 - --- compiler/ncgmem.pas | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/ncgmem.pas b/compiler/ncgmem.pas index 92779b3dd9..0a76017774 100644 --- a/compiler/ncgmem.pas +++ b/compiler/ncgmem.pas @@ -771,8 +771,12 @@ implementation begin inc(location.reference.offset, bytemulsize*tordconstnode(right).value); - { don't do this for floats etc. } - if (tcgsize2size[newsize] <> bytemulsize) then + { don't do this for floats etc.; needed to properly set the } + { size for bitpacked arrays (e.g. a bitpacked array of } + { enums who are size 2 but fit in one byte -> in the array } + { they will be one byte and have to be stored like that) } + if is_packed_array(left.resulttype.def) and + (tcgsize2size[newsize] <> bytemulsize) then newsize:=int_cgsize(bytemulsize); end else