Browse Source

* bug fix for @tobject.method, fixes bug #557, 605 and 606

florian 26 years ago
parent
commit
35eef74308
2 changed files with 13 additions and 5 deletions
  1. 6 2
      compiler/pexpr.pas
  2. 7 3
      compiler/tcld.pas

+ 6 - 2
compiler/pexpr.pas

@@ -1032,7 +1032,8 @@ unit pexpr;
                                         not(pobjectdef(pd)^.is_class) then
                                         not(pobjectdef(pd)^.is_class) then
                                        begin
                                        begin
                                          consume(_POINT);
                                          consume(_POINT);
-                                         if assigned(procinfo._class) then
+                                         if assigned(procinfo._class) and
+                                           not(getaddr) then
                                           begin
                                           begin
                                             if procinfo._class^.is_related(pobjectdef(pd)) then
                                             if procinfo._class^.is_related(pobjectdef(pd)) then
                                              begin
                                              begin
@@ -2092,7 +2093,10 @@ _LECKKLAMMER : begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.140  1999-09-11 09:08:33  florian
+  Revision 1.141  1999-09-11 19:47:26  florian
+    * bug fix for @tobject.method, fixes bug 557, 605 and 606
+
+  Revision 1.140  1999/09/11 09:08:33  florian
     * fixed bug 596
     * fixed bug 596
     * fixed some problems with procedure variables and procedures of object,
     * fixed some problems with procedure variables and procedures of object,
       especially in TP mode. Procedure of object doesn't apply only to classes,
       especially in TP mode. Procedure of object doesn't apply only to classes,

+ 7 - 3
compiler/tcld.pas

@@ -37,7 +37,7 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,globals,systems,
+      cobjects,verbose,globtype,globals,systems,
       symconst,symtable,aasm,types,
       symconst,symtable,aasm,types,
       hcodegen,htypechk,pass_1,
       hcodegen,htypechk,pass_1,
       tccnv,cpubase
       tccnv,cpubase
@@ -192,7 +192,8 @@ implementation
                    { left must be set, if left isn't set       }
                    { left must be set, if left isn't set       }
                    { it can be only self                       }
                    { it can be only self                       }
                    { this code is only used in TP procvar mode }
                    { this code is only used in TP procvar mode }
-                   if not(assigned(p^.left)) and
+                   if (m_tp_procvar in aktmodeswitches) and
+                      not(assigned(p^.left)) and
                      (pprocsym(p^.symtableentry)^.owner^.symtabletype=objectsymtable) then
                      (pprocsym(p^.symtableentry)^.owner^.symtabletype=objectsymtable) then
                       p^.left:=genselfnode(procinfo._class);
                       p^.left:=genselfnode(procinfo._class);
                    { method pointer ? }
                    { method pointer ? }
@@ -503,7 +504,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.43  1999-09-11 09:08:34  florian
+  Revision 1.44  1999-09-11 19:47:26  florian
+    * bug fix for @tobject.method, fixes bug 557, 605 and 606
+
+  Revision 1.43  1999/09/11 09:08:34  florian
     * fixed bug 596
     * fixed bug 596
     * fixed some problems with procedure variables and procedures of object,
     * fixed some problems with procedure variables and procedures of object,
       especially in TP mode. Procedure of object doesn't apply only to classes,
       especially in TP mode. Procedure of object doesn't apply only to classes,