mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 19:29:24 +02:00
* better methodpointer check for proc->procvar
This commit is contained in:
parent
bab0edbe32
commit
a08b5a8bff
@ -76,7 +76,7 @@
|
||||
{ relevant options for assigning a proc or a procvar to a procvar }
|
||||
po_compatibility_options = $7FFFFFFF-
|
||||
(poassembler+pomsgstr+pomsgint+
|
||||
povirtualmethod+pooverridingmethod+pomethodpointer);
|
||||
povirtualmethod+pooverridingmethod);
|
||||
|
||||
{ options for objects and classes }
|
||||
oo_is_abstract = $1; { true, if the object/class has an abstract }
|
||||
@ -111,7 +111,10 @@
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.10 1999-06-01 19:27:56 peter
|
||||
Revision 1.11 1999-06-03 09:34:11 peter
|
||||
* better methodpointer check for proc->procvar
|
||||
|
||||
Revision 1.10 1999/06/01 19:27:56 peter
|
||||
* better checks for procvar and methodpointer
|
||||
|
||||
Revision 1.9 1999/05/24 08:55:29 florian
|
||||
|
@ -181,12 +181,12 @@ implementation
|
||||
begin
|
||||
{ it could also be a procvar, not only pprocsym ! }
|
||||
if p^.left^.symtableprocentry^.typ=varsym then
|
||||
hp:=genloadnode(pvarsym(p^.left^.symtableprocentry),p^.left^.symtableproc)
|
||||
hp:=genloadnode(pvarsym(p^.left^.symtableentry),p^.left^.symtableproc)
|
||||
else
|
||||
begin
|
||||
if assigned(p^.left^.methodpointer) and
|
||||
(p^.left^.methodpointer^.resulttype^.deftype=objectdef) and
|
||||
(pobjectdef(p^.left^.methodpointer^.resulttype)^.isclass) then
|
||||
{ generate a methodcallnode or proccallnode }
|
||||
if (p^.left^.symtableprocentry^.owner^.symtabletype=objectsymtable) and
|
||||
(pobjectdef(p^.left^.symtableprocentry^.owner^.defowner)^.isclass) then
|
||||
begin
|
||||
hp:=genloadmethodcallnode(pprocsym(p^.left^.symtableprocentry),p^.left^.symtableproc,
|
||||
getcopy(p^.left^.methodpointer));
|
||||
@ -208,13 +208,18 @@ implementation
|
||||
|
||||
{ it could also be a procvar, not only pprocsym ! }
|
||||
if p^.left^.symtableprocentry^.typ=varsym then
|
||||
hp3:=pabstractprocdef(pvarsym(p^.left^.symtableprocentry)^.definition)
|
||||
hp3:=pabstractprocdef(pvarsym(p^.left^.symtableentry)^.definition)
|
||||
else
|
||||
hp3:=pabstractprocdef(pprocsym(p^.left^.symtableprocentry)^.definition);
|
||||
|
||||
pprocvardef(p^.resulttype)^.options:=hp3^.options;
|
||||
pprocvardef(p^.resulttype)^.retdef:=hp3^.retdef;
|
||||
|
||||
{ method ? then set the methodpointer flag }
|
||||
if (hp3^.owner^.symtabletype=objectsymtable) and
|
||||
(pobjectdef(hp3^.owner^.defowner)^.isclass) then
|
||||
pprocvardef(p^.resulttype)^.options:=pprocvardef(p^.resulttype)^.options or pomethodpointer;
|
||||
|
||||
hp2:=hp3^.para1;
|
||||
while assigned(hp2) do
|
||||
begin
|
||||
@ -565,7 +570,10 @@ implementation
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.17 1999-05-27 19:45:24 peter
|
||||
Revision 1.18 1999-06-03 09:34:12 peter
|
||||
* better methodpointer check for proc->procvar
|
||||
|
||||
Revision 1.17 1999/05/27 19:45:24 peter
|
||||
* removed oldasm
|
||||
* plabel -> pasmlabel
|
||||
* -a switches to source writing automaticly
|
||||
|
@ -258,11 +258,11 @@ implementation
|
||||
Message(type_e_no_method_and_procedure_not_compatible);
|
||||
exit;
|
||||
end;
|
||||
{ check the other things }
|
||||
{ check the other things, methodpointer is already checked }
|
||||
if is_equal(def1^.retdef,def2^.retdef) and
|
||||
convertable_paras(def1^.para1,def2^.para1,false) and
|
||||
((def1^.options and po_compatibility_options)=
|
||||
(def2^.options and po_compatibility_options)) then
|
||||
((def1^.options and (po_compatibility_options-pomethodpointer))=
|
||||
(def2^.options and (po_compatibility_options-pomethodpointer))) then
|
||||
proc_to_procvar_equal:=true
|
||||
else
|
||||
proc_to_procvar_equal:=false;
|
||||
@ -928,7 +928,10 @@ implementation
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.70 1999-06-02 22:25:55 pierre
|
||||
Revision 1.71 1999-06-03 09:34:13 peter
|
||||
* better methodpointer check for proc->procvar
|
||||
|
||||
Revision 1.70 1999/06/02 22:25:55 pierre
|
||||
types.pas
|
||||
|
||||
Revision 1.69 1999/06/02 10:11:55 florian
|
||||
|
Loading…
Reference in New Issue
Block a user