mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 23:29:13 +02:00
* convert string constants passed to JLString to unicode
git-svn-id: branches/jvmbackend@18563 -
This commit is contained in:
parent
446d91eaab
commit
6374b473ff
@ -33,6 +33,7 @@ interface
|
|||||||
function typecheck_dynarray_to_openarray: tnode; override;
|
function typecheck_dynarray_to_openarray: tnode; override;
|
||||||
function typecheck_string_to_chararray: tnode; override;
|
function typecheck_string_to_chararray: tnode; override;
|
||||||
function pass_1: tnode; override;
|
function pass_1: tnode; override;
|
||||||
|
function simplify(forinline: boolean): tnode; override;
|
||||||
|
|
||||||
procedure second_int_to_int;override;
|
procedure second_int_to_int;override;
|
||||||
{ procedure second_string_to_string;override; }
|
{ procedure second_string_to_string;override; }
|
||||||
@ -196,6 +197,19 @@ implementation
|
|||||||
result:=inherited pass_1;
|
result:=inherited pass_1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function tjvmtypeconvnode.simplify(forinline: boolean): tnode;
|
||||||
|
begin
|
||||||
|
result:=inherited simplify(forinline);
|
||||||
|
if assigned(result) then
|
||||||
|
exit;
|
||||||
|
{ string constants passed to java.lang.String must be converted to
|
||||||
|
widestring }
|
||||||
|
if (left.nodetype=stringconstn) and
|
||||||
|
not(tstringconstnode(left).cst_type in [cst_unicodestring,cst_widestring]) and
|
||||||
|
(maybe_find_real_class_definition(resultdef,false)=java_jlstring) then
|
||||||
|
inserttypeconv(left,cunicodestringtype);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{*****************************************************************************
|
{*****************************************************************************
|
||||||
SecondTypeConv
|
SecondTypeConv
|
||||||
|
Loading…
Reference in New Issue
Block a user