* better set_to_set for setconst nodes

git-svn-id: trunk@6656 -
This commit is contained in:
florian 2007-02-25 21:07:32 +00:00
parent 5b8dd4c004
commit 821e6abae1

View File

@ -1153,22 +1153,14 @@ implementation
function ttypeconvnode.typecheck_set_to_set : tnode; function ttypeconvnode.typecheck_set_to_set : tnode;
begin begin
result:=nil; result:=nil;
{ because is_equal only checks the basetype for sets we need to { constant sets can be converted by changing the type only }
check here if we are loading a smallset into a normalset } if (left.nodetype=setconstn) then
if (resultdef.typ=setdef) and begin
(left.resultdef.typ=setdef) and left.resultdef:=resultdef;
((tsetdef(resultdef).setmax<>tsetdef(left.resultdef).setmax) or result:=left;
(tsetdef(resultdef).setbase<>tsetdef(left.resultdef).setbase)) then left:=nil;
begin exit;
{ constant sets can be converted by changing the type only } end;
if (left.nodetype=setconstn) then
begin
left.resultdef:=resultdef;
result:=left;
left:=nil;
exit;
end;
end;
end; end;