mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-24 13:41:38 +02:00
* fix methodpointer compare, compare only the proc field
This commit is contained in:
parent
d4f0a5fc08
commit
d45dea5db8
@ -102,6 +102,7 @@ implementation
|
|||||||
rd,ld : tdef;
|
rd,ld : tdef;
|
||||||
htype : ttype;
|
htype : ttype;
|
||||||
ot : tnodetype;
|
ot : tnodetype;
|
||||||
|
hsym : tfieldvarsym;
|
||||||
concatstrings : boolean;
|
concatstrings : boolean;
|
||||||
resultset : Tconstset;
|
resultset : Tconstset;
|
||||||
i : longint;
|
i : longint;
|
||||||
@ -1267,10 +1268,25 @@ implementation
|
|||||||
begin
|
begin
|
||||||
if (nodetype in [equaln,unequaln]) then
|
if (nodetype in [equaln,unequaln]) then
|
||||||
begin
|
begin
|
||||||
{ convert both to voidpointer, because methodpointers are 8 bytes }
|
if tprocvardef(rd).is_addressonly then
|
||||||
{ even though only the first 4 bytes must be compared (JM) }
|
begin
|
||||||
inserttypeconv_internal(left,voidpointertype);
|
inserttypeconv_internal(right,voidpointertype);
|
||||||
inserttypeconv_internal(right,voidpointertype);
|
inserttypeconv_internal(left,voidpointertype);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
{ find proc field in methodpointer record }
|
||||||
|
hsym:=tfieldvarsym(trecorddef(methodpointertype.def).symtable.search('proc'));
|
||||||
|
if not assigned(hsym) then
|
||||||
|
internalerror(200412043);
|
||||||
|
{ Compare tmehodpointer(left).proc }
|
||||||
|
right:=csubscriptnode.create(
|
||||||
|
hsym,
|
||||||
|
ctypeconvnode.create_internal(right,methodpointertype));
|
||||||
|
left:=csubscriptnode.create(
|
||||||
|
hsym,
|
||||||
|
ctypeconvnode.create_internal(left,methodpointertype));
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
|
CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
|
||||||
@ -2032,7 +2048,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.131 2004-11-02 12:55:16 peter
|
Revision 1.132 2004-12-06 15:57:22 peter
|
||||||
|
* fix methodpointer compare, compare only the proc field
|
||||||
|
|
||||||
|
Revision 1.131 2004/11/02 12:55:16 peter
|
||||||
* nf_internal flag for internal inserted typeconvs. This will
|
* nf_internal flag for internal inserted typeconvs. This will
|
||||||
supress the generation of warning/hints
|
supress the generation of warning/hints
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user