mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 11:09:42 +02:00
* preparations to use generic string concatentation/comparison code for JVM
targets: o initialize managed temps that are passed as var-parameters to the dests-parameter of the concat routines, because they will be read and stored in the var-parameter array (they are finalized and hence work fine on native targets, but finalization is a nop on the JVM target) o do not take the shortcut of comparing with nil when checking for an empty ansi/unicodestring on managed VM targets git-svn-id: branches/jvmbackend@18909 -
This commit is contained in:
parent
b570ddf010
commit
1fbd8750f2
@ -1982,6 +1982,16 @@ implementation
|
||||
result:=internalstatements(newstatement);
|
||||
tempnode:=ctempcreatenode.create(resultdef,resultdef.size,tt_persistent,true);
|
||||
addstatement(newstatement,tempnode);
|
||||
{ initialize the temp, since it will be passed to a
|
||||
var-parameter (and finalization, which is performed by the
|
||||
ttempcreate node and which takes care of the initialization
|
||||
on native targets, is a noop on managed VM targets) }
|
||||
if (target_info.system in systems_managed_vm) and
|
||||
is_managed_type(resultdef) then
|
||||
addstatement(newstatement,cinlinenode.create(in_setlength_x,
|
||||
false,
|
||||
ccallparanode.create(genintconstnode(0),
|
||||
ccallparanode.create(ctemprefnode.create(tempnode),nil))));
|
||||
addstatement(newstatement,ccallnode.createintern('fpc_'+
|
||||
tstringdef(resultdef).stringtypname+'_concat',
|
||||
ccallparanode.create(right,
|
||||
@ -2013,7 +2023,8 @@ implementation
|
||||
nodetype:=swap_relation[nodetype];
|
||||
end;
|
||||
if is_shortstring(left.resultdef) or
|
||||
(nodetype in [gtn,gten,ltn,lten]) then
|
||||
(nodetype in [gtn,gten,ltn,lten]) or
|
||||
(target_info.system in systems_managed_vm) then
|
||||
{ compare the length with 0 }
|
||||
result := caddnode.create(nodetype,
|
||||
cinlinenode.create(in_length_x,false,left),
|
||||
|
Loading…
Reference in New Issue
Block a user