* when internally taking the address of shortstrings to typecast

them to shortstringclass, make sure the address operator is
    "typed" so that we don't insert useless checkcast instructions

git-svn-id: branches/jvmbackend@18621 -
This commit is contained in:
Jonas Maebe 2011-08-20 08:15:59 +00:00
parent 569228447d
commit bf2854dae5
2 changed files with 4 additions and 0 deletions

View File

@ -98,6 +98,8 @@ function tjvmassignmentnode.pass_1: tnode;
inserttypeconv_explicit(right,cchartype);
{ call ShortstringClass(@shortstring).setChar(index,char) }
tvecnode(target).left:=caddrnode.create_internal(tvecnode(target).left);
{ avoid useless typecheck when casting to shortstringclass }
include(tvecnode(target).left.flags,nf_typedaddr);
inserttypeconv_explicit(tvecnode(target).left,java_shortstring);
psym:=search_struct_member(tabstractrecorddef(java_shortstring),'SETCHAR');
if not assigned(psym) or

View File

@ -218,6 +218,8 @@ implementation
begin
stringclass:=java_shortstring;
left:=caddrnode.create_internal(left);
{ avoid useless typecheck when casting to shortstringclass }
include(left.flags,nf_typedaddr);
end
else
internalerror(2011052407);