mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 23:39:26 +02:00
Avoid internal error 2002042430 and check overloading before calling simplify method
git-svn-id: trunk@20635 -
This commit is contained in:
parent
25e0f7c882
commit
7101151b5c
@ -190,10 +190,6 @@ implementation
|
|||||||
maybe_call_procvar(left,true);
|
maybe_call_procvar(left,true);
|
||||||
maybe_call_procvar(right,true);
|
maybe_call_procvar(right,true);
|
||||||
|
|
||||||
result:=simplify(false);
|
|
||||||
if assigned(result) then
|
|
||||||
exit;
|
|
||||||
|
|
||||||
{ allow operator overloading }
|
{ allow operator overloading }
|
||||||
t:=self;
|
t:=self;
|
||||||
if isbinaryoverloaded(t) then
|
if isbinaryoverloaded(t) then
|
||||||
@ -204,12 +200,22 @@ implementation
|
|||||||
|
|
||||||
{ we need 2 orddefs always }
|
{ we need 2 orddefs always }
|
||||||
if (left.resultdef.typ<>orddef) then
|
if (left.resultdef.typ<>orddef) then
|
||||||
inserttypeconv(right,sinttype);
|
inserttypeconv(left,sinttype);
|
||||||
if (right.resultdef.typ<>orddef) then
|
if (right.resultdef.typ<>orddef) then
|
||||||
inserttypeconv(right,sinttype);
|
inserttypeconv(right,sinttype);
|
||||||
if codegenerror then
|
if codegenerror then
|
||||||
exit;
|
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);
|
rd:=torddef(right.resultdef);
|
||||||
ld:=torddef(left.resultdef);
|
ld:=torddef(left.resultdef);
|
||||||
|
|
||||||
@ -567,10 +573,6 @@ implementation
|
|||||||
maybe_call_procvar(left,true);
|
maybe_call_procvar(left,true);
|
||||||
maybe_call_procvar(right,true);
|
maybe_call_procvar(right,true);
|
||||||
|
|
||||||
result:=simplify(false);
|
|
||||||
if assigned(result) then
|
|
||||||
exit;
|
|
||||||
|
|
||||||
{ allow operator overloading }
|
{ allow operator overloading }
|
||||||
t:=self;
|
t:=self;
|
||||||
if isbinaryoverloaded(t) then
|
if isbinaryoverloaded(t) then
|
||||||
@ -579,6 +581,10 @@ implementation
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
result:=simplify(false);
|
||||||
|
if assigned(result) then
|
||||||
|
exit;
|
||||||
|
|
||||||
{$ifdef cpunodefaultint}
|
{$ifdef cpunodefaultint}
|
||||||
{ for small cpus we use the smallest common type }
|
{ for small cpus we use the smallest common type }
|
||||||
if (left.resultdef.typ=orddef) and (right.resultdef.typ=orddef) then
|
if (left.resultdef.typ=orddef) and (right.resultdef.typ=orddef) then
|
||||||
|
Loading…
Reference in New Issue
Block a user