Browse Source

* fixed regvar bug in in-node code (regvar could be modified by
"in" code)

git-svn-id: trunk@3191 -

Jonas Maebe 19 năm trước cách đây
mục cha
commit
0a10fac060
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      compiler/ncgset.pas

+ 2 - 2
compiler/ncgset.pas

@@ -302,9 +302,9 @@ implementation
                       if (left.location.loc = LOC_CREGISTER) and
                       if (left.location.loc = LOC_CREGISTER) and
                          (hr<>pleftreg) then
                          (hr<>pleftreg) then
                         begin
                         begin
-                          cg.a_op_const_reg(current_asmdata.CurrAsmList,OP_SUB,opsize,setparts[i].start,pleftreg);
+                          { don't change this back to a_op_const_reg/a_load_reg_reg, since pleftreg must not be modified }
                           hr:=cg.getintregister(current_asmdata.CurrAsmList,opsize);
                           hr:=cg.getintregister(current_asmdata.CurrAsmList,opsize);
-                          cg.a_load_reg_reg(current_asmdata.CurrAsmList,opsize,opsize,pleftreg,hr);
+                          cg.a_op_const_reg_reg(current_asmdata.CurrAsmList,OP_SUB,opsize,setparts[i].start,pleftreg,hr);
                           pleftreg:=hr;
                           pleftreg:=hr;
                         end
                         end
                       else
                       else