Avoid internal error 2002042430 and check overloading before calling simplify method

git-svn-id: trunk@20635 -
This commit is contained in:
pierre 2012-03-26 15:44:47 +00:00
parent 25e0f7c882
commit 7101151b5c

View File

@ -190,10 +190,6 @@ implementation
maybe_call_procvar(left,true);
maybe_call_procvar(right,true);
result:=simplify(false);
if assigned(result) then
exit;
{ allow operator overloading }
t:=self;
if isbinaryoverloaded(t) then
@ -204,12 +200,22 @@ implementation
{ we need 2 orddefs always }
if (left.resultdef.typ<>orddef) then
inserttypeconv(right,sinttype);
inserttypeconv(left,sinttype);
if (right.resultdef.typ<>orddef) then
inserttypeconv(right,sinttype);
if codegenerror then
exit;
{ Try only now to simply constant
as otherwise you might create
tconstnode with return type that are
not compatible with tconst node
as in bug report 21566 PM }
result:=simplify(false);
if assigned(result) then
exit;
rd:=torddef(right.resultdef);
ld:=torddef(left.resultdef);
@ -567,10 +573,6 @@ implementation
maybe_call_procvar(left,true);
maybe_call_procvar(right,true);
result:=simplify(false);
if assigned(result) then
exit;
{ allow operator overloading }
t:=self;
if isbinaryoverloaded(t) then
@ -579,6 +581,10 @@ implementation
exit;
end;
result:=simplify(false);
if assigned(result) then
exit;
{$ifdef cpunodefaultint}
{ for small cpus we use the smallest common type }
if (left.resultdef.typ=orddef) and (right.resultdef.typ=orddef) then