Prechádzať zdrojové kódy

* only potentially change size of vecn results in case of packed arrays

git-svn-id: trunk@4681 -
Jonas Maebe 19 rokov pred
rodič
commit
25059eb03d
1 zmenil súbory, kde vykonal 6 pridanie a 2 odobranie
  1. 6 2
      compiler/ncgmem.pas

+ 6 - 2
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