mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-17 03:19:33 +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(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
|
||||
|
Loading…
Reference in New Issue
Block a user