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