mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 02:29:12 +02:00
* changed the asizeint and asizeuint to 32-bit on CPUs with 16-bit address
space, in order to allow data structures larger than 32k (and less than 64k) git-svn-id: trunk@32529 -
This commit is contained in:
parent
f65cb5d933
commit
bfa96171e0
@ -92,8 +92,16 @@ interface
|
|||||||
PAInt = ^AInt;
|
PAInt = ^AInt;
|
||||||
|
|
||||||
{ target cpu specific type used to store data sizes }
|
{ target cpu specific type used to store data sizes }
|
||||||
|
{$ifdef cpu16bitaddr}
|
||||||
|
{ on small CPUs such as i8086, we use LongInt to support data structures
|
||||||
|
larger than 32767 bytes and up to 65535 bytes in size. Since asizeint
|
||||||
|
must be signed, we use LongInt/LongWord. }
|
||||||
|
ASizeInt = LongInt;
|
||||||
|
ASizeUInt = LongWord;
|
||||||
|
{$else cpu16bitaddr}
|
||||||
ASizeInt = PInt;
|
ASizeInt = PInt;
|
||||||
ASizeUInt = PUInt;
|
ASizeUInt = PUInt;
|
||||||
|
{$endif cpu16bitaddr}
|
||||||
|
|
||||||
{ type used for handling constants etc. in the code generator }
|
{ type used for handling constants etc. in the code generator }
|
||||||
TCGInt = Int64;
|
TCGInt = Int64;
|
||||||
|
@ -3781,6 +3781,13 @@ implementation
|
|||||||
if (ado_IsBitPacked in arrayoptions) then
|
if (ado_IsBitPacked in arrayoptions) then
|
||||||
{ can't just add 7 and divide by 8, because that may overflow }
|
{ can't just add 7 and divide by 8, because that may overflow }
|
||||||
result:=result div 8 + ord((result mod 8)<>0);
|
result:=result div 8 + ord((result mod 8)<>0);
|
||||||
|
{$ifdef cpu16bitaddr}
|
||||||
|
if result>65535 then
|
||||||
|
begin
|
||||||
|
result:=-1;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
{$endif cpu16bitaddr}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user