mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 06:19:28 +02:00
* fixed some vmt problems, especially related to overloaded methods
in objects/classes
This commit is contained in:
parent
e112b16a51
commit
889e43db8a
@ -85,3 +85,5 @@ Changes in the syntax or semantic of FPC:
|
|||||||
29/02/00 ORDERSOURCES released => PPU version change
|
29/02/00 ORDERSOURCES released => PPU version change
|
||||||
this allows for a more correct include file hunting order.
|
this allows for a more correct include file hunting order.
|
||||||
01/04/00 fix the handling of value parameters in cdecl function
|
01/04/00 fix the handling of value parameters in cdecl function
|
||||||
|
11/05/00 changed vmt handling to fix problems some problems
|
||||||
|
with overloading in objects
|
||||||
|
@ -467,6 +467,35 @@ implementation
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure newdefentry;
|
||||||
|
|
||||||
|
begin
|
||||||
|
new(procdefcoll);
|
||||||
|
procdefcoll^.data:=hp;
|
||||||
|
procdefcoll^.next:=symcoll^.data;
|
||||||
|
symcoll^.data:=procdefcoll;
|
||||||
|
|
||||||
|
{ if it's a virtual method }
|
||||||
|
if (po_virtualmethod in hp^.procoptions) then
|
||||||
|
begin
|
||||||
|
{ then it gets a number ... }
|
||||||
|
hp^.extnumber:=nextvirtnumber;
|
||||||
|
{ and we inc the number }
|
||||||
|
inc(nextvirtnumber);
|
||||||
|
has_virtual_method:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if (hp^.proctypeoption=potype_constructor) then
|
||||||
|
has_constructor:=true;
|
||||||
|
|
||||||
|
{ check, if a method should be overridden }
|
||||||
|
if (po_overridingmethod in hp^.procoptions) then
|
||||||
|
MessagePos1(hp^.fileinfo,parser_e_nothing_to_be_overridden,_c^.objname^+'.'+_name+hp^.demangled_paras);
|
||||||
|
end;
|
||||||
|
|
||||||
|
label
|
||||||
|
handlenextdef;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
{ put only sub routines into the VMT }
|
{ put only sub routines into the VMT }
|
||||||
if psym(sym)^.typ=procsym then
|
if psym(sym)^.typ=procsym then
|
||||||
@ -507,8 +536,6 @@ implementation
|
|||||||
we hide the method }
|
we hide the method }
|
||||||
if _c=hp^._class then
|
if _c=hp^._class then
|
||||||
Message1(parser_w_should_use_override,_c^.objname^+'.'+_name);
|
Message1(parser_w_should_use_override,_c^.objname^+'.'+_name);
|
||||||
newentry;
|
|
||||||
exit;
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if _c=hp^._class then
|
if _c=hp^._class then
|
||||||
@ -518,9 +545,10 @@ implementation
|
|||||||
else
|
else
|
||||||
Message1(parser_w_overloaded_are_not_both_non_virtual,
|
Message1(parser_w_overloaded_are_not_both_non_virtual,
|
||||||
_c^.objname^+'.'+_name);
|
_c^.objname^+'.'+_name);
|
||||||
newentry;
|
|
||||||
exit;
|
|
||||||
end;
|
end;
|
||||||
|
{ was newentry; exit; (FK) }
|
||||||
|
newdefentry;
|
||||||
|
goto handlenextdef;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
{ the flags have to match }
|
{ the flags have to match }
|
||||||
@ -544,7 +572,8 @@ implementation
|
|||||||
we hide the method }
|
we hide the method }
|
||||||
if _c=hp^._class then
|
if _c=hp^._class then
|
||||||
Message1(parser_w_should_use_override,_c^.objname^+'.'+_name);
|
Message1(parser_w_should_use_override,_c^.objname^+'.'+_name);
|
||||||
newentry;
|
{ was newentry; (FK) }
|
||||||
|
newdefentry;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -564,6 +593,7 @@ implementation
|
|||||||
{ and exchange }
|
{ and exchange }
|
||||||
procdefcoll^.data:=hp;
|
procdefcoll^.data:=hp;
|
||||||
stored:=true;
|
stored:=true;
|
||||||
|
goto handlenextdef;
|
||||||
end; { same parameters }
|
end; { same parameters }
|
||||||
procdefcoll:=procdefcoll^.next;
|
procdefcoll:=procdefcoll^.next;
|
||||||
end;
|
end;
|
||||||
@ -587,6 +617,7 @@ implementation
|
|||||||
MessagePos1(hp^.fileinfo,parser_e_nothing_to_be_overridden,
|
MessagePos1(hp^.fileinfo,parser_e_nothing_to_be_overridden,
|
||||||
_c^.objname^+'.'+_name+hp^.demangled_paras);
|
_c^.objname^+'.'+_name+hp^.demangled_paras);
|
||||||
end;
|
end;
|
||||||
|
handlenextdef:
|
||||||
hp:=hp^.nextoverloaded;
|
hp:=hp^.nextoverloaded;
|
||||||
end;
|
end;
|
||||||
exit;
|
exit;
|
||||||
@ -608,9 +639,12 @@ implementation
|
|||||||
|
|
||||||
{ walk through all public syms }
|
{ walk through all public syms }
|
||||||
{ I had to change that to solve bug0260 (PM)}
|
{ I had to change that to solve bug0260 (PM)}
|
||||||
{_c:=_class;}
|
{ _c:=p; }
|
||||||
_c:=p;
|
_c:=_class;
|
||||||
{ Florian, please check if you agree (PM) }
|
{ Florian, please check if you agree (PM) }
|
||||||
|
{ no it wasn't correct, but I fixed it at }
|
||||||
|
{ another place: your fix hides only a bug }
|
||||||
|
{ _c is only used to give correct warnings }
|
||||||
p^.symtable^.foreach({$ifndef TP}@{$endif}eachsym);
|
p^.symtable^.foreach({$ifndef TP}@{$endif}eachsym);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -697,7 +731,11 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.27 2000-04-29 12:49:30 peter
|
Revision 1.28 2000-05-11 06:55:28 florian
|
||||||
|
* fixed some vmt problems, especially related to overloaded methods
|
||||||
|
in objects/classes
|
||||||
|
|
||||||
|
Revision 1.27 2000/04/29 12:49:30 peter
|
||||||
* fixed long line for tp7
|
* fixed long line for tp7
|
||||||
|
|
||||||
Revision 1.26 2000/03/06 15:57:42 peter
|
Revision 1.26 2000/03/06 15:57:42 peter
|
||||||
|
@ -44,15 +44,15 @@ type
|
|||||||
const
|
const
|
||||||
{$ifdef newcg}
|
{$ifdef newcg}
|
||||||
{$ifdef ORDERSOURCES}
|
{$ifdef ORDERSOURCES}
|
||||||
CurrentPPUVersion=101;
|
CurrentPPUVersion=103;
|
||||||
{$else ORDERSOURCES}
|
{$else ORDERSOURCES}
|
||||||
CurrentPPUVersion=100;
|
CurrentPPUVersion=102;
|
||||||
{$endif ORDERSOURCES}
|
{$endif ORDERSOURCES}
|
||||||
{$else newcg}
|
{$else newcg}
|
||||||
{$ifdef ORDERSOURCES}
|
{$ifdef ORDERSOURCES}
|
||||||
CurrentPPUVersion=19;
|
CurrentPPUVersion=21;
|
||||||
{$else ORDERSOURCES}
|
{$else ORDERSOURCES}
|
||||||
CurrentPPUVersion=18;
|
CurrentPPUVersion=20;
|
||||||
{$endif ORDERSOURCES}
|
{$endif ORDERSOURCES}
|
||||||
{$endif newcg}
|
{$endif newcg}
|
||||||
|
|
||||||
@ -1006,7 +1006,11 @@ end;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.56 2000-02-29 21:58:31 pierre
|
Revision 1.57 2000-05-11 06:54:29 florian
|
||||||
|
* fixed some vmt problems, especially related to overloaded methods
|
||||||
|
in objects/classes
|
||||||
|
|
||||||
|
Revision 1.56 2000/02/29 21:58:31 pierre
|
||||||
* ORDERSOURCES released
|
* ORDERSOURCES released
|
||||||
|
|
||||||
Revision 1.55 2000/02/09 13:22:59 peter
|
Revision 1.55 2000/02/09 13:22:59 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user