Browse Source

sizeof(TPOINT) problem

pierre 27 years ago
parent
commit
8aa4df4046
3 changed files with 34 additions and 5 deletions
  1. 10 1
      compiler/pdecl.pas
  2. 10 3
      compiler/pexpr.pas
  3. 14 1
      compiler/symdef.inc

+ 10 - 1
compiler/pdecl.pas

@@ -1327,6 +1327,7 @@ unit pdecl;
                             consume(ID);
                             consume(ID);
                             consume(SEMICOLON);
                             consume(SEMICOLON);
                             aktprocsym^.definition^.options:=aktprocsym^.definition^.options or povirtualmethod;
                             aktprocsym^.definition^.options:=aktprocsym^.definition^.options or povirtualmethod;
+                            aktclass^.options:=aktclass^.options or oo_hasvirtual;
                           end
                           end
                          else
                          else
                           if (pattern='OVERRIDE') then
                           if (pattern='OVERRIDE') then
@@ -2036,7 +2037,15 @@ unit pdecl;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.53  1998-09-09 11:50:52  pierre
+  Revision 1.54  1998-09-17 13:41:16  pierre
+  sizeof(TPOINT) problem
+
+  Revision 1.53.2.1  1998/09/17 13:12:09  pierre
+    * virtual destructor did not set oo_hasvirtual
+      (detected with the sizeof(TPoint) problem
+    * genloadcallnode was missing
+
+  Revision 1.53  1998/09/09 11:50:52  pierre
     * forward def are not put in record or objects
     * forward def are not put in record or objects
     + added check for forwards also in record and objects
     + added check for forwards also in record and objects
     * dummy parasymtable for unit initialization removed from
     * dummy parasymtable for unit initialization removed from

+ 10 - 3
compiler/pexpr.pas

@@ -194,8 +194,9 @@ unit pexpr;
                       begin
                       begin
                         Must_be_valid:=false;
                         Must_be_valid:=false;
                         do_firstpass(p1);
                         do_firstpass(p1);
-                        if (p1^.resulttype^.deftype=objectdef) or
-                           is_open_array(p1^.resulttype) then
+                        if ((p1^.resulttype^.deftype=objectdef) and
+                           ((pobjectdef(p1^.resulttype)^.options and oo_hasvirtual)<>0))
+                          or is_open_array(p1^.resulttype) then
                          statement_syssym:=geninlinenode(in_sizeof_x,false,p1)
                          statement_syssym:=geninlinenode(in_sizeof_x,false,p1)
                         else
                         else
                          begin
                          begin
@@ -1855,7 +1856,13 @@ unit pexpr;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.49  1998-09-09 11:50:53  pierre
+  Revision 1.50  1998-09-17 13:41:18  pierre
+  sizeof(TPOINT) problem
+
+  Revision 1.49.2.1  1998/09/17 08:42:31  pierre
+  TPOINT sizeof fix
+
+  Revision 1.49  1998/09/09 11:50:53  pierre
     * forward def are not put in record or objects
     * forward def are not put in record or objects
     + added check for forwards also in record and objects
     + added check for forwards also in record and objects
     * dummy parasymtable for unit initialization removed from
     * dummy parasymtable for unit initialization removed from

+ 14 - 1
compiler/symdef.inc

@@ -2415,6 +2415,13 @@
         deftype:=objectdef;
         deftype:=objectdef;
         childof:=c;
         childof:=c;
         options:=0;
         options:=0;
+        { some options are inherited !! }
+        if assigned(c) then
+          options:= c^.options and
+                    (oo_hasvirtual or oo_hasprivate or
+                     oo_hasprotected
+                     {or oo_can_have_published treated in pdecl }
+                     );
         { privatesyms:=new(psymtable,init(objectsymtable));
         { privatesyms:=new(psymtable,init(objectsymtable));
       protectedsyms:=new(psymtable,init(objectsymtable)); }
       protectedsyms:=new(psymtable,init(objectsymtable)); }
         publicsyms:=new(psymtable,init(objectsymtable));
         publicsyms:=new(psymtable,init(objectsymtable));
@@ -2956,7 +2963,13 @@
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.41  1998-09-15 17:39:30  jonas
+  Revision 1.42  1998-09-17 13:41:20  pierre
+  sizeof(TPOINT) problem
+
+  Revision 1.40.2.2  1998/09/17 08:42:33  pierre
+  TPOINT sizeof fix
+
+  Revision 1.41  1998/09/15 17:39:30  jonas
     + bugfix from bugfix branch
     + bugfix from bugfix branch
 
 
   Revision 1.40.2.1  1998/09/15 17:35:32  jonas
   Revision 1.40.2.1  1998/09/15 17:35:32  jonas