Просмотр исходного кода

+ also simplify rol(x,0) and ror(x,0) to x

git-svn-id: trunk@36024 -
nickysn 8 лет назад
Родитель
Сommit
b17d97050f
1 измененных файлов с 7 добавлено и 1 удалено
  1. 7 1
      compiler/ninl.pas

+ 7 - 1
compiler/ninl.pas

@@ -2023,12 +2023,18 @@ implementation
               if (left.nodetype=callparan) and
                  assigned(tcallparanode(left).right) then
                 begin
+                  vl:=tordconstnode(tcallparanode(left).left).value;
                   if (tcallparanode(tcallparanode(left).right).left.nodetype=ordconstn) then
                     begin
                       def:=tcallparanode(tcallparanode(left).right).left.resultdef;
-                      vl:=tordconstnode(tcallparanode(left).left).value;
                       vl2:=tordconstnode(tcallparanode(tcallparanode(left).right).left).value;
                     end
+                  else if vl=0 then
+                    begin
+                      result:=tcallparanode(tcallparanode(left).right).left;
+                      tcallparanode(tcallparanode(left).right).left:=nil;
+                      exit;
+                    end
                   else
                     exit;
                 end