* fix for normal method calls inside static methods :

WARNING there were both parser and codegen errors !!
    added static_call boolean to calln tree
This commit is contained in:
pierre 1999-02-11 09:46:21 +00:00
parent 88605549b8
commit f59803f7d2
4 changed files with 44 additions and 9 deletions

View File

@ -805,10 +805,14 @@ implementation
begin begin
{ static functions contain the vmt_address in ESI } { static functions contain the vmt_address in ESI }
{ also class methods } { also class methods }
{ Here it is quite tricky because it also depends }
{ on the methodpointer PM }
if assigned(aktprocsym) then if assigned(aktprocsym) then
begin begin
if ((aktprocsym^.properties and sp_static)<>0) or if ((((aktprocsym^.properties and sp_static)<>0) or
((aktprocsym^.definition^.options and poclassmethod)<>0) or ((aktprocsym^.definition^.options and poclassmethod)<>0)) and
((p^.methodpointer=nil) or (p^.methodpointer^.treetype=typen)))
or
((p^.procdefinition^.options and postaticmethod)<>0) or ((p^.procdefinition^.options and postaticmethod)<>0) or
((p^.procdefinition^.options and poconstructor)<>0) or ((p^.procdefinition^.options and poconstructor)<>0) or
{ ESI is loaded earlier } { ESI is loaded earlier }
@ -1300,7 +1304,12 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.66 1999-02-09 15:45:46 florian Revision 1.67 1999-02-11 09:46:21 pierre
* fix for normal method calls inside static methods :
WARNING there were both parser and codegen errors !!
added static_call boolean to calln tree
Revision 1.66 1999/02/09 15:45:46 florian
+ complex results for assembler functions, fixes bug0155 + complex results for assembler functions, fixes bug0155
Revision 1.65 1999/02/08 11:29:04 pierre Revision 1.65 1999/02/08 11:29:04 pierre

View File

@ -790,7 +790,7 @@ unit pexpr;
Factor_read_id Factor_read_id
---------------------------------------------} ---------------------------------------------}
procedure factor_read_id; procedure factor_read_id;
begin begin
{ allow post fix operators } { allow post fix operators }
again:=true; again:=true;
@ -1129,7 +1129,10 @@ unit pexpr;
PostFixOperators PostFixOperators
---------------------------------------------} ---------------------------------------------}
procedure postfixoperators; procedure postfixoperators;
var
store_static : boolean;
{ p1 and p2 must contain valid value_str } { p1 and p2 must contain valid value_str }
begin begin
check_tokenpos; check_tokenpos;
@ -1312,6 +1315,8 @@ unit pexpr;
begin begin
classh:=pobjectdef(pd); classh:=pobjectdef(pd);
sym:=nil; sym:=nil;
store_static:=allow_only_static;
allow_only_static:=false;
while assigned(classh) do while assigned(classh) do
begin begin
sym:=pvarsym(classh^.publicsyms^.search(pattern)); sym:=pvarsym(classh^.publicsyms^.search(pattern));
@ -1320,6 +1325,7 @@ unit pexpr;
break; break;
classh:=classh^.childof; classh:=classh^.childof;
end; end;
allow_only_static:=store_static;
consume(ID); consume(ID);
do_member_read(false,sym,p1,pd,again); do_member_read(false,sym,p1,pd,again);
end; end;
@ -1934,7 +1940,12 @@ unit pexpr;
end. end.
{ {
$Log$ $Log$
Revision 1.82 1999-01-28 14:06:47 florian Revision 1.83 1999-02-11 09:46:25 pierre
* fix for normal method calls inside static methods :
WARNING there were both parser and codegen errors !!
added static_call boolean to calln tree
Revision 1.82 1999/01/28 14:06:47 florian
* small fix for method pointers * small fix for method pointers
* found the annoying strpas bug, mainly nested call to type cast which * found the annoying strpas bug, mainly nested call to type cast which
use ansistrings crash use ansistrings crash

View File

@ -779,6 +779,7 @@ unit pstatmnt;
var var
p,p2 : ptree; p,p2 : ptree;
ht : ttoken; ht : ttoken;
store_allow : boolean;
again : boolean; { dummy for do_proc_call } again : boolean; { dummy for do_proc_call }
destrukname : stringid; destrukname : stringid;
sym : psym; sym : psym;
@ -853,7 +854,10 @@ unit pstatmnt;
sym:=nil; sym:=nil;
while assigned(classh) do while assigned(classh) do
begin begin
store_allow:=allow_only_static;
allow_only_static:=false;
sym:=classh^.publicsyms^.search(pattern); sym:=classh^.publicsyms^.search(pattern);
allow_only_static:=store_allow;
srsymtable:=classh^.publicsyms; srsymtable:=classh^.publicsyms;
if assigned(sym) then if assigned(sym) then
break; break;
@ -1259,7 +1263,12 @@ unit pstatmnt;
end. end.
{ {
$Log$ $Log$
Revision 1.63 1999-02-09 15:45:47 florian Revision 1.64 1999-02-11 09:46:26 pierre
* fix for normal method calls inside static methods :
WARNING there were both parser and codegen errors !!
added static_call boolean to calln tree
Revision 1.63 1999/02/09 15:45:47 florian
+ complex results for assembler functions, fixes bug0155 + complex results for assembler functions, fixes bug0155
Revision 1.62 1999/01/27 13:06:57 pierre Revision 1.62 1999/01/27 13:06:57 pierre

View File

@ -242,7 +242,8 @@ unit tree;
calln : (symtableprocentry : psym; calln : (symtableprocentry : psym;
symtableproc : psymtable;procdefinition : pprocdef; symtableproc : psymtable;procdefinition : pprocdef;
methodpointer : ptree; methodpointer : ptree;
no_check,unit_specific,return_value_used : boolean); no_check,unit_specific,
return_value_used,static_call : boolean);
ordconstn : (value : longint); ordconstn : (value : longint);
realconstn : (value_real : bestreal;lab_real : plabel;realtyp : tait); realconstn : (value_real : bestreal;lab_real : plabel;realtyp : tait);
fixconstn : (value_fix: longint); fixconstn : (value_fix: longint);
@ -1685,7 +1686,12 @@ unit tree;
end. end.
{ {
$Log$ $Log$
Revision 1.64 1999-01-27 12:57:22 pierre Revision 1.65 1999-02-11 09:46:31 pierre
* fix for normal method calls inside static methods :
WARNING there were both parser and codegen errors !!
added static_call boolean to calln tree
Revision 1.64 1999/01/27 12:57:22 pierre
* memory leaks with hightree solved by adding a new disposetyp * memory leaks with hightree solved by adding a new disposetyp
dt_leftrighthigh dt_leftrighthigh