فهرست منبع

* two bugs regarding method variables fixed
- if you take in a method the address of another method
don't need self anymore
- if the class pointer was in a register, wrong code for a method
variable load was generated

florian 26 سال پیش
والد
کامیت
cc8c629550
2فایلهای تغییر یافته به همراه24 افزوده شده و 3 حذف شده
  1. 9 2
      compiler/cg386ld.pas
  2. 15 1
      compiler/pexpr.pas

+ 9 - 2
compiler/cg386ld.pas

@@ -290,7 +290,7 @@ implementation
                          hp^:=p^.location.reference;
                          inc(hp^.offset,4);
                          exprasmlist^.concat(new(pai386,op_reg_ref(A_MOV,S_L,
-                           R_EDI,hp)));
+                           hregister,hp)));
 
                          { virtual method ? }
                          if (pprocsym(p^.symtableentry)^.definition^.options and povirtualmethod)<>0 then
@@ -852,7 +852,14 @@ implementation
 end.
 {
   $Log$
-  Revision 1.61  1999-06-28 22:29:11  florian
+  Revision 1.62  1999-06-30 15:43:18  florian
+    * two bugs regarding method variables fixed
+      - if you take in a method the address of another method
+        don't need self anymore
+      - if the class pointer was in a register, wrong code for a method
+        variable load was generated
+
+  Revision 1.61  1999/06/28 22:29:11  florian
     * qword division fixed
     + code for qword/int64 type casting added:
       range checking isn't implemented yet

+ 15 - 1
compiler/pexpr.pas

@@ -554,6 +554,13 @@ unit pexpr;
                 (p1^.symtableproc^.defowner^.deftype=objectdef) then
                 begin
                    p1^.methodpointer:=getcopy(pwithsymtable(p1^.symtableproc)^.withrefnode);
+                end
+              else if not(assigned(p1^.methodpointer)) then
+                begin
+                   { we must provide a method pointer, if it isn't given, }
+                   { it is self                                           }
+                   p1^.methodpointer:=genselfnode(procinfo._class);
+                   p1^.methodpointer^.resulttype:=procinfo._class;
                 end;
               { no postfix operators }
               again:=false;
@@ -2035,7 +2042,14 @@ unit pexpr;
 end.
 {
   $Log$
-  Revision 1.116  1999-06-26 00:24:53  pierre
+  Revision 1.117  1999-06-30 15:43:20  florian
+    * two bugs regarding method variables fixed
+      - if you take in a method the address of another method
+        don't need self anymore
+      - if the class pointer was in a register, wrong code for a method
+        variable load was generated
+
+  Revision 1.116  1999/06/26 00:24:53  pierre
    * mereg from fixes-0_99_12 branch
 
   Revision 1.112.2.4  1999/06/26 00:22:30  pierre