mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-12 11:09:14 +02:00
* tcg.g_array_rtti_helper(): When converting 'high' to 'length', use an intermediate register to do the increment, so that the original value of 'high' parameter is preserved regardless of platform and optimization settings. Should fix regressions introduced by r17068.
git-svn-id: trunk@17071 -
This commit is contained in:
parent
54bc8efa0b
commit
37d5a6c354
@ -3586,7 +3586,7 @@ implementation
|
||||
var
|
||||
cgpara1,cgpara2,cgpara3: TCGPara;
|
||||
href: TReference;
|
||||
hreg: TRegister;
|
||||
hreg, lenreg: TRegister;
|
||||
begin
|
||||
cgpara1.init;
|
||||
cgpara2.init;
|
||||
@ -3604,9 +3604,10 @@ implementation
|
||||
a_load_loc_reg(list,OS_INT,highloc,hreg);
|
||||
end;
|
||||
{ increment, converts high(x) to length(x) }
|
||||
a_op_const_reg(list,OP_ADD,OS_INT,1,hreg);
|
||||
lenreg:=getintregister(list,OS_INT);
|
||||
a_op_const_reg_reg(list,OP_ADD,OS_INT,1,hreg,lenreg);
|
||||
|
||||
a_load_reg_cgpara(list,OS_INT,hreg,cgpara3);
|
||||
a_load_reg_cgpara(list,OS_INT,lenreg,cgpara3);
|
||||
a_loadaddr_ref_cgpara(list,href,cgpara2);
|
||||
a_loadaddr_ref_cgpara(list,ref,cgpara1);
|
||||
paramanager.freecgpara(list,cgpara1);
|
||||
|
Loading…
Reference in New Issue
Block a user