mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-23 15:31:41 +02:00
* convert array indices always to s32int, because that is the index type used
by java arrays (otherwise we may get unwanted sign extensions after performing e.g. an s16bit operation, see the test) git-svn-id: trunk@26472 -
This commit is contained in:
parent
67413a2823
commit
a5653916e0
@ -427,6 +427,14 @@ implementation
|
||||
object instances (since that's what they are in Java) }
|
||||
right.resultdef:=s32inttype;
|
||||
right.location.size:=OS_S32;
|
||||
end
|
||||
else if (right.location.loc<>LOC_CONSTANT) and
|
||||
((right.resultdef.typ<>orddef) or
|
||||
(torddef(right.resultdef).ordtype<>s32bit)) then
|
||||
begin
|
||||
{ Java array indices are always 32 bit signed integers }
|
||||
hlcg.location_force_reg(current_asmdata.CurrAsmList,right.location,right.resultdef,s32inttype,true);
|
||||
right.resultdef:=s32inttype;
|
||||
end;
|
||||
|
||||
{ adjust index if necessary }
|
||||
|
@ -280,3 +280,7 @@ ppcjvm -O2 -g -B -CTinitlocals tinitvar
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
javaa -Dfile.encoding=UTF-8 -cp ..\..\..\rtl\units\jvm-java;. org.freepascal.test.tinitvar.tinitvar
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
ppcjvm -O2 -g -B -CTinitlocals tsmallintarr
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
javaa -Dfile.encoding=UTF-8 -cp ..\..\..\rtl\units\jvm-java;. tsmallintarr
|
||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||
|
@ -156,3 +156,5 @@ javac -encoding utf-8 -cp ../../../rtl/units/$RTLDIR:. tjavalowercaseproc.java
|
||||
java -Dfile.encoding=UTF-8 -cp ../../../rtl/units/$RTLDIR:. tjavalowercaseproc
|
||||
$PPC -O2 -g -B -Sa -CTinitlocals tinitvar
|
||||
java -Dfile.encoding=UTF-8 -cp ../../../rtl/units/$RTLDIR:. org.freepascal.test.tinitvar.tinitvar
|
||||
$PPC -O2 -g -B -Sa tsmallintarr
|
||||
java -Dfile.encoding=UTF-8 -cp ../../../rtl/units/$RTLDIR:. tsmallintarr
|
||||
|
Loading…
Reference in New Issue
Block a user