mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 05:49:23 +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);
|
consume(_INDEX);
|
||||||
pt:=comp_expr(true,false);
|
pt:=comp_expr(true,false);
|
||||||
{ Only allow enum and integer indexes. Convert all integer
|
{ Only allow enum and integer indexes. Convert all integer
|
||||||
values to s32int to be compatible with delphi, because the
|
values to objpas.integer (s32int on 32- and 64-bit targets,
|
||||||
procedure matching requires equal parameters }
|
s16int on 16- and 8-bit) to be compatible with delphi,
|
||||||
|
because the procedure matching requires equal parameters }
|
||||||
if is_constnode(pt) and
|
if is_constnode(pt) and
|
||||||
is_ordinal(pt.resultdef)
|
is_ordinal(pt.resultdef)
|
||||||
and (not is_64bitint(pt.resultdef))
|
and (not is_64bitint(pt.resultdef))
|
||||||
|
{$if defined(cpu8bitalu) or defined(cpu16bitalu)}
|
||||||
|
and (not is_32bitint(pt.resultdef))
|
||||||
|
{$endif}
|
||||||
then
|
then
|
||||||
begin
|
begin
|
||||||
if is_integer(pt.resultdef) then
|
if is_integer(pt.resultdef) then
|
||||||
|
{$if defined(cpu8bitalu) or defined(cpu16bitalu)}
|
||||||
|
inserttypeconv_internal(pt,s16inttype);
|
||||||
|
{$else}
|
||||||
inserttypeconv_internal(pt,s32inttype);
|
inserttypeconv_internal(pt,s32inttype);
|
||||||
|
{$endif}
|
||||||
p.index:=tordconstnode(pt).value.svalue;
|
p.index:=tordconstnode(pt).value.svalue;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user