Browse Source

* small fix for method pointers
* found the annoying strpas bug, mainly nested call to type cast which
use ansistrings crash

florian 26 years ago
parent
commit
3134c9352e
3 changed files with 28 additions and 17 deletions
  1. 10 7
      compiler/cg386cnv.pas
  2. 10 2
      compiler/pexpr.pas
  3. 8 8
      compiler/todo.txt

+ 10 - 7
compiler/cg386cnv.pas

@@ -1455,12 +1455,6 @@ implementation
          oldrl:=temptoremove;
          temptoremove:=new(plinkedlist,init);
 
-         { the helper routines need access to the release list }
-         ltemptoremove:=oldrl;
-
-         if not(assigned(ltemptoremove)) then
-           internalerror(18011);
-
          { this isn't good coding, I think tc_bool_2_int, shouldn't be }
          { type conversion (FK)                                        }
 
@@ -1473,6 +1467,10 @@ implementation
               if codegenerror then
                exit;
            end;
+         { the helper routines need access to the release list }
+         { but do this AFTER secondpass(p^.left), else it is   }
+         { overwritten by recursive calls                      }
+         ltemptoremove:=oldrl;
          { the second argument only is for maybe_range_checking !}
          secondconvert[p^.convtyp](p,p^.left,p^.convtyp);
 
@@ -1592,7 +1590,12 @@ implementation
 end.
 {
   $Log$
-  Revision 1.49  1999-01-27 14:56:56  pierre
+  Revision 1.50  1999-01-28 14:06:45  florian
+    * small fix for method pointers
+    * found the annoying strpas bug, mainly nested call to type cast which
+      use ansistrings crash
+
+  Revision 1.49  1999/01/27 14:56:56  pierre
   * typo error corrected solves bug0190 and bug0204
 
   Revision 1.48  1999/01/27 13:03:27  pierre

+ 10 - 2
compiler/pexpr.pas

@@ -1835,6 +1835,7 @@ unit pexpr;
                                  if ((getprocvardef^.options and pomethodpointer)<>0) then
                                    begin
                                       if (p2^.methodpointer^.resulttype^.deftype=objectdef) and
+                                         (pobjectdef(p2^.methodpointer^.resulttype)^.isclass) and
                                          (proc_to_procvar_equal(getprocvardef,pprocsym(p2^.symtableentry)^.definition)) then
                                         begin
                                            p2^.treetype:=loadn;
@@ -1842,7 +1843,9 @@ unit pexpr;
                                            p2^.left:=p2^.methodpointer;
                                            p2^.resulttype:=pprocsym(p2^.symtableprocentry)^.definition;
                                            p2^.symtableentry:=pvarsym(p2^.symtableprocentry);
-                                        end;
+                                        end
+                                      else
+                                        Message(type_e_mismatch);
                                    end
                                  else if (proc_to_procvar_equal(getprocvardef,pprocsym(p2^.symtableentry)^.definition)) then
                                    begin
@@ -1931,7 +1934,12 @@ unit pexpr;
 end.
 {
   $Log$
-  Revision 1.81  1999-01-27 00:13:55  florian
+  Revision 1.82  1999-01-28 14:06:47  florian
+    * small fix for method pointers
+    * found the annoying strpas bug, mainly nested call to type cast which
+      use ansistrings crash
+
+  Revision 1.81  1999/01/27 00:13:55  florian
     * "procedure of object"-stuff fixed
 
   Revision 1.80  1999/01/21 16:41:01  pierre

+ 8 - 8
compiler/todo.txt

@@ -13,10 +13,10 @@ compiler version and your short cut.
         - indexed properties ..................................... 0.99.6 (FK)
         - default properties ..................................... 0.99.6 (FK)
     - save array for overriding
-    - stored qualifier
+        - stored qualifier ...................................... 0.99.11 (FK)
         - read/write from/to unit file ........................... 0.99.6 (FK)
   - call of destructor helper routine
-  - message qualifier
+        - message qualifier ..................................... 0.99.11 (FK)
         - correct handling of constructor result type ............ 0.99.6 (FK)
         - rtti ................................................... 0.99.8 (FK)
         - published .............................................. 0.99.8 (FK)
@@ -27,13 +27,13 @@ compiler version and your short cut.
           - generation ........................................... 0.99.7 (FK)
           - use when copying etc. ................................ 0.99.7 (FK)
           - new/dispose should look for rtti'ed data ............. 0.99.8 (FK)
-  - enumeration names
+          - enumeration names ................................... 0.99.11 (FK)
   - methodpointers
   - change booleans into enumerations
 * AnsiString
-  - operators
-  - indexed access
-  - type conversations
+          - operators ........................................... 0.99.11 (FK)
+          - indexed access ...................................... 0.99.11 (FK)
+          - type conversions .................................... 0.99.11 (FK)
 * LongString and WideString
 * MMX support by the compiler
           - unary minus .......................................... 0.99.1 (FK)
@@ -68,7 +68,7 @@ compiler version and your short cut.
         - make length internal................................... 0.99.7 (PFV)
 - fix all bugs of the bug directory
 - range checking for open arrays
-- method pointers (procedure of object)
+        - method pointers (procedure of object) ................ 0.99.11 (FK)
 - sysutils unit for go32v2 (excpetions!)
 - initialisation/finalization for units
 - fixed data type
@@ -76,4 +76,4 @@ compiler version and your short cut.
 - $B
 - open strings, $P
 - include/exclude
-  
+