* fix missing self setting for method to procvar conversion in

tp_procvar mode
This commit is contained in:
peter 2003-03-17 18:54:23 +00:00
parent 15e9a5eb13
commit 07f1898c68
2 changed files with 27 additions and 11 deletions

View File

@ -182,7 +182,7 @@ implementation
verbose,globals, verbose,globals,
symconst,paramgr,defutil,defcmp, symconst,paramgr,defutil,defcmp,
htypechk,pass_1,cpubase, htypechk,pass_1,cpubase,
nbas,ncnv,nld,ninl,nadd,ncon, nbas,ncnv,nld,ninl,nadd,ncon,nmem,
rgobj,cgbase rgobj,cgbase
; ;
@ -1758,9 +1758,13 @@ type
(symtableprocentry.procdef_count=1) then (symtableprocentry.procdef_count=1) then
begin begin
hpt:=cloadnode.create(tprocsym(symtableprocentry),symtableproc); hpt:=cloadnode.create(tprocsym(symtableprocentry),symtableproc);
if (symtableprocentry.owner.symtabletype=objectsymtable) and if (symtableprocentry.owner.symtabletype=objectsymtable) then
assigned(methodpointer) then begin
tloadnode(hpt).set_mp(methodpointer.getcopy); if assigned(methodpointer) then
tloadnode(hpt).set_mp(methodpointer.getcopy)
else
tloadnode(hpt).set_mp(cselfnode.create(tobjectdef(symtableprocentry.owner.defowner)));
end;
resulttypepass(hpt); resulttypepass(hpt);
result:=hpt; result:=hpt;
end end
@ -2395,7 +2399,11 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.130 2003-03-17 16:54:41 peter Revision 1.131 2003-03-17 18:54:23 peter
* fix missing self setting for method to procvar conversion in
tp_procvar mode
Revision 1.130 2003/03/17 16:54:41 peter
* support DefaultHandler and anonymous inheritance fixed * support DefaultHandler and anonymous inheritance fixed
for message methods for message methods

View File

@ -1119,9 +1119,13 @@ implementation
currprocdef:=Tprocsym(Tcallnode(left).symtableprocentry).search_procdef_byprocvardef(Tprocvardef(resulttype.def)); currprocdef:=Tprocsym(Tcallnode(left).symtableprocentry).search_procdef_byprocvardef(Tprocvardef(resulttype.def));
hp:=cloadnode.create_procvar(tprocsym(tcallnode(left).symtableprocentry), hp:=cloadnode.create_procvar(tprocsym(tcallnode(left).symtableprocentry),
currprocdef,tcallnode(left).symtableproc); currprocdef,tcallnode(left).symtableproc);
if (tcallnode(left).symtableprocentry.owner.symtabletype=objectsymtable) and if (tcallnode(left).symtableprocentry.owner.symtabletype=objectsymtable) then
assigned(tcallnode(left).methodpointer) then begin
tloadnode(hp).set_mp(tcallnode(left).methodpointer.getcopy); if assigned(tcallnode(left).methodpointer) then
tloadnode(hp).set_mp(tcallnode(left).methodpointer.getcopy)
else
tloadnode(hp).set_mp(cselfnode.create(tobjectdef(tcallnode(left).symtableprocentry.owner.defowner)));
end;
end; end;
resulttypepass(hp); resulttypepass(hp);
left.free; left.free;
@ -1385,7 +1389,7 @@ implementation
if is_signed(left.resulttype.def) then if is_signed(left.resulttype.def) then
fname := 'fpc_int64_to_'+typname fname := 'fpc_int64_to_'+typname
else else
{$warning generic conversion from int to float does not support unsigned integers} {$warning generic conversion from int to float does not support unsigned integers}
fname := 'fpc_int64_to_'+typname; fname := 'fpc_int64_to_'+typname;
result := ccallnode.createintern(fname,ccallparanode.create( result := ccallnode.createintern(fname,ccallparanode.create(
left,nil)); left,nil));
@ -1396,7 +1400,7 @@ implementation
else else
{ other integers are supposed to be 32 bit } { other integers are supposed to be 32 bit }
begin begin
{$warning generic conversion from int to float does not support unsigned integers} {$warning generic conversion from int to float does not support unsigned integers}
if is_signed(left.resulttype.def) then if is_signed(left.resulttype.def) then
fname := 'fpc_longint_to_'+typname fname := 'fpc_longint_to_'+typname
else else
@ -2027,7 +2031,11 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.102 2003-02-15 22:15:57 carl Revision 1.103 2003-03-17 18:54:23 peter
* fix missing self setting for method to procvar conversion in
tp_procvar mode
Revision 1.102 2003/02/15 22:15:57 carl
* generic conversaion routines only work on signed types * generic conversaion routines only work on signed types
Revision 1.101 2003/01/16 22:13:52 peter Revision 1.101 2003/01/16 22:13:52 peter