* fixed another IE with indexing bitpacked arrays of composite types,

this time with constant rather than variable indices

git-svn-id: trunk@7599 -
This commit is contained in:
Jonas Maebe 2007-06-08 13:53:01 +00:00
parent 445d116b78
commit de75b34dba
3 changed files with 19 additions and 1 deletions

1
.gitattributes vendored
View File

@ -6908,6 +6908,7 @@ tests/test/tparray18.pp svneol=native#text/plain
tests/test/tparray19.pp svneol=native#text/plain
tests/test/tparray2.pp svneol=native#text/plain
tests/test/tparray20.pp svneol=native#text/plain
tests/test/tparray21.pp svneol=native#text/plain
tests/test/tparray3.pp svneol=native#text/plain
tests/test/tparray4.pp svneol=native#text/plain
tests/test/tparray5.pp svneol=native#text/plain

View File

@ -781,7 +781,9 @@ implementation
end;
if not(is_packed_array(left.resultdef)) or
((mulsize mod 8 = 0) and
ispowerof2(mulsize div 8,temp)) then
(ispowerof2(mulsize div 8,temp) or
{ only orddefs are bitpacked }
not is_ordinal(resultdef))) then
begin
inc(location.reference.offset,
bytemulsize*tordconstnode(right).value);

15
tests/test/tparray21.pp Normal file
View File

@ -0,0 +1,15 @@
{$mode macpas}
program FatalError_200301231;
type
note_name_type = packed array[0..17] of string[2];
var
nn: note_name_type;
s: string[ 80];
begin
nn[1]:= 'x';
s:=concat( 'y', nn[ 1]);
if (s <> 'yx') then
halt(1);
end.