Browse Source

* framepointer cannot be changed to esp for methods

Jonas Maebe 26 years ago
parent
commit
88306ed3f3
2 changed files with 14 additions and 4 deletions
  1. 6 2
      compiler/pass_2.pas
  2. 8 2
      compiler/pstatmnt.pas

+ 6 - 2
compiler/pass_2.pas

@@ -449,7 +449,8 @@ implementation
                    (*
                    if assigned(aktprocsym) then
                      begin
-                       if not(aktprocsym^.definition^.proctypeoption in [potype_constructor,potype_destructor]) and
+                       if not(assigned(procinfo._class)) and
+                          not(aktprocsym^.definition^.proctypeoption in [potype_constructor,potype_destructor]) and
                           not(po_interrupt in aktprocsym^.definition^.procoptions) and
                           ((procinfo.flags and pi_do_call)=0) and
                           (lexlevel>=normal_function_level) then
@@ -671,7 +672,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.35  1999-08-27 10:46:26  pierre
+  Revision 1.36  1999-09-07 14:12:35  jonas
+    * framepointer cannot be changed to esp for methods
+
+  Revision 1.35  1999/08/27 10:46:26  pierre
    + some EXTTEMPREGDEBUG code added
 
   Revision 1.34  1999/08/25 12:00:01  jonas

+ 8 - 2
compiler/pstatmnt.pas

@@ -1289,7 +1289,10 @@ unit pstatmnt;
            { set the framepointer to esp for assembler functions }
            { but only if the are no local variables           }
            { added no parameter also (PM)                       }
-           if (po_assembler in aktprocsym^.definition^.procoptions) and
+           { disable for methods, because self pointer is expected }
+           { at -8(%ebp) (JM)                                      }
+           if not(assigned(procinfo._class)) and
+              (po_assembler in aktprocsym^.definition^.procoptions) and
               (aktprocsym^.definition^.localst^.datasize=0) and
               (aktprocsym^.definition^.parast^.datasize=0) and
               not(ret_in_param(aktprocsym^.definition^.retdef)) then
@@ -1312,7 +1315,10 @@ unit pstatmnt;
 end.
 {
   $Log$
-  Revision 1.99  1999-08-26 21:10:08  peter
+  Revision 1.100  1999-09-07 14:12:36  jonas
+    * framepointer cannot be changed to esp for methods
+
+  Revision 1.99  1999/08/26 21:10:08  peter
     * better error recovery for case
 
   Revision 1.98  1999/08/05 16:53:05  peter