summaryrefslogtreecommitdiff
path: root/compiler/ncgmem.pas
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/ncgmem.pas')
-rw-r--r--compiler/ncgmem.pas14
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/ncgmem.pas b/compiler/ncgmem.pas
index 5ae2e79fba..b80ae15208 100644
--- a/compiler/ncgmem.pas
+++ b/compiler/ncgmem.pas
@@ -300,7 +300,7 @@ implementation
pd:=tprocdef(tprocsym(sym).ProcdefList[0]);
paraloc1.init;
paramanager.getintparaloc(pd,1,paraloc1);
- hlcg.a_load_reg_cgpara(current_asmdata.CurrAsmList,resultdef,location.reference.base,paraloc1);
+ hlcg.a_load_reg_cgpara(current_asmdata.CurrAsmList,left.resultdef,location.reference.base,paraloc1);
paramanager.freecgpara(current_asmdata.CurrAsmList,paraloc1);
paraloc1.done;
hlcg.allocallcpuregisters(current_asmdata.CurrAsmList);
@@ -383,7 +383,7 @@ implementation
internalerror(2012010602);
pd:=tprocdef(tprocsym(sym).ProcdefList[0]);
paramanager.getintparaloc(pd,1,paraloc1);
- hlcg.a_load_reg_cgpara(current_asmdata.CurrAsmList,resultdef,location.reference.base,paraloc1);
+ hlcg.a_load_reg_cgpara(current_asmdata.CurrAsmList,left.resultdef,location.reference.base,paraloc1);
paramanager.freecgpara(current_asmdata.CurrAsmList,paraloc1);
hlcg.allocallcpuregisters(current_asmdata.CurrAsmList);
hlcg.a_call_name(current_asmdata.CurrAsmList,pd,'FPC_CHECKPOINTER',nil,false);
@@ -446,14 +446,14 @@ implementation
offsetcorrection:=0;
if (left.location.size in [OS_PAIR,OS_SPAIR]) then
begin
- if (vs.fieldoffset>=sizeof(aword)) then
- begin
- location.sreg.subsetreg := left.location.registerhi;
- offsetcorrection:=sizeof(aword)*8;
- end
+ if (vs.fieldoffset>=sizeof(aword)) xor (target_info.endian=endian_big) then
+ location.sreg.subsetreg := left.location.registerhi
else
location.sreg.subsetreg := left.location.register;
+ if (vs.fieldoffset>=sizeof(aword)) then
+ offsetcorrection:=sizeof(aword)*8;
+
location.sreg.subsetregsize := OS_INT;
end
else