Переглянути джерело

* set the bit mask, used for modulus by power-of-2 in a way, that is independent
from the sign of the divisor (so that negative powers of 2 can be supported as
well in the future)

git-svn-id: trunk@36928 -

nickysn 8 роки тому
батько
коміт
910e1eccc8
1 змінених файлів з 2 додано та 2 видалено
  1. 2 2
      compiler/nmat.pas

+ 2 - 2
compiler/nmat.pas

@@ -574,7 +574,7 @@ implementation
                   exit;
 
                 shiftval:=left.resultdef.size*8-1;
-                dec(tordconstnode(right).value.uvalue);
+                tordconstnode(right).value.uvalue:=qword((qword(1) shl power)-1);
 
                 result:=internalstatements(statements);
                 temp:=ctempcreatenode.create(left.resultdef,left.resultdef.size,tt_persistent,true);
@@ -618,7 +618,7 @@ implementation
               end
             else
               begin
-                dec(tordconstnode(right).value.uvalue);
+                tordconstnode(right).value.uvalue:=qword((qword(1) shl power)-1);
                 result := caddnode.create(andn,left,right);
               end;
             { left and right are reused }