* fixed tcgtypeconvnode.second_cstring_to_pchar for i8086 far data memory models by using the high level code generator

git-svn-id: trunk@27324 -
This commit is contained in:
nickysn 2014-03-28 18:36:14 +00:00
parent e465ab355b
commit 0aab7fcc9c

View File

@ -273,19 +273,21 @@ interface
begin begin
if left.nodetype<>stringconstn then if left.nodetype<>stringconstn then
internalerror(200601131); internalerror(200601131);
location_reset(location,LOC_REGISTER,OS_ADDR); if not is_pchar(resultdef) and not is_pwidechar(resultdef) then
internalerror(2014032802);
location_reset(location,LOC_REGISTER,def_cgsize(resultdef));
case tstringconstnode(left).cst_type of case tstringconstnode(left).cst_type of
cst_conststring : cst_conststring :
begin begin
location.register:=cg.getaddressregister(current_asmdata.CurrAsmList); location.register:=hlcg.getaddressregister(current_asmdata.CurrAsmList,resultdef);
cg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,left.location.reference,location.register); hlcg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,left.resultdef,resultdef,left.location.reference,location.register);
end; end;
cst_shortstring : cst_shortstring :
begin begin
inc(left.location.reference.offset); inc(left.location.reference.offset);
location.reference.alignment:=1; location.reference.alignment:=1;
location.register:=cg.getaddressregister(current_asmdata.CurrAsmList); location.register:=hlcg.getaddressregister(current_asmdata.CurrAsmList,resultdef);
cg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,left.location.reference,location.register); hlcg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,left.resultdef,resultdef,left.location.reference,location.register);
end; end;
cst_widestring, cst_widestring,
cst_unicodestring, cst_unicodestring,
@ -296,8 +298,8 @@ interface
{ FPC_EMPTYCHAR is a widechar -> 2 bytes } { FPC_EMPTYCHAR is a widechar -> 2 bytes }
reference_reset(hr,2); reference_reset(hr,2);
hr.symbol:=current_asmdata.RefAsmSymbol('FPC_EMPTYCHAR'); hr.symbol:=current_asmdata.RefAsmSymbol('FPC_EMPTYCHAR');
location.register:=cg.getaddressregister(current_asmdata.CurrAsmList); location.register:=hlcg.getaddressregister(current_asmdata.CurrAsmList,resultdef);
cg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,hr,location.register); hlcg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,left.resultdef,resultdef,hr,location.register);
end end
else else
begin begin