+ simplify sar(x,0) to x

git-svn-id: trunk@36023 -
This commit is contained in:
nickysn 2017-04-30 20:24:44 +00:00
parent d8ec0eff8e
commit 8ac84ce43a

View File

@ -1961,12 +1961,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