mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 23:21:57 +02:00
* use a 16-bit integer for property indexes on 16- and 8-bit targets
git-svn-id: trunk@27062 -
This commit is contained in:
parent
dcc2354760
commit
b4bb09254e
@ -456,15 +456,23 @@ implementation
|
||||
consume(_INDEX);
|
||||
pt:=comp_expr(true,false);
|
||||
{ Only allow enum and integer indexes. Convert all integer
|
||||
values to s32int to be compatible with delphi, because the
|
||||
procedure matching requires equal parameters }
|
||||
values to objpas.integer (s32int on 32- and 64-bit targets,
|
||||
s16int on 16- and 8-bit) to be compatible with delphi,
|
||||
because the procedure matching requires equal parameters }
|
||||
if is_constnode(pt) and
|
||||
is_ordinal(pt.resultdef)
|
||||
and (not is_64bitint(pt.resultdef))
|
||||
{$if defined(cpu8bitalu) or defined(cpu16bitalu)}
|
||||
and (not is_32bitint(pt.resultdef))
|
||||
{$endif}
|
||||
then
|
||||
begin
|
||||
if is_integer(pt.resultdef) then
|
||||
{$if defined(cpu8bitalu) or defined(cpu16bitalu)}
|
||||
inserttypeconv_internal(pt,s16inttype);
|
||||
{$else}
|
||||
inserttypeconv_internal(pt,s32inttype);
|
||||
{$endif}
|
||||
p.index:=tordconstnode(pt).value.svalue;
|
||||
end
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user