Browse Source

* fixed generic code for subtracting one set from another if both are
in registers, because the left set could be overwritten before its
last use

git-svn-id: trunk@18792 -

Jonas Maebe 14 năm trước cách đây
mục cha
commit
1bb9a3b3d7
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  1. 7 0
      compiler/ncgadd.pas

+ 7 - 0
compiler/ncgadd.pas

@@ -303,6 +303,13 @@ interface
                   if (right.location.size<>left.location.size) or
                      (location.size<>left.location.size) then
                     internalerror(2010123001);
+                  { make sure that location.register is different from
+                    left.location.register, since right will overwrite it
+                    and we'll use left afterwards }
+                  if (right.location.loc=LOC_REGISTER) then
+                    location.register:=right.location.register
+                  else
+                    location.register:=cg.getintregister(current_asmdata.CurrAsmList,location.size);
                   { make sure we don't modify left/right.location, because we told
                     force_reg_left_right above that they can be constant }
                   cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_NOT,location.size,right.location.register,location.register);