浏览代码

* don't use inc/dec on a property with a write method

git-svn-id: trunk@7245 -
Jonas Maebe 18 年之前
父节点
当前提交
ae54e01b72
共有 1 个文件被更改,包括 7 次插入3 次删除
  1. 7 3
      compiler/symdef.pas

+ 7 - 3
compiler/symdef.pas

@@ -3876,10 +3876,13 @@ implementation
              if not (objecttype in [odt_interfacecom,odt_interfacecorba,odt_dispinterface]) then
              if not (objecttype in [odt_interfacecom,odt_interfacecorba,odt_dispinterface]) then
                begin
                begin
                   { add the data of the anchestor class }
                   { add the data of the anchestor class }
-                  inc(tObjectSymtable(symtable).datasize,tObjectSymtable(c.symtable).datasize);
+                  tObjectSymtable(symtable).datasize:=
+                    tObjectSymtable(symtable).datasize+
+                    tObjectSymtable(c.symtable).datasize;
                   if (oo_has_vmt in objectoptions) and
                   if (oo_has_vmt in objectoptions) and
                      (oo_has_vmt in c.objectoptions) then
                      (oo_has_vmt in c.objectoptions) then
-                    dec(tObjectSymtable(symtable).datasize,sizeof(aint));
+                    tObjectSymtable(symtable).datasize:=
+                      tObjectSymtable(symtable).datasize-sizeof(aint);
                   { if parent has a vmt field then
                   { if parent has a vmt field then
                     the offset is the same for the child PM }
                     the offset is the same for the child PM }
                   if (oo_has_vmt in c.objectoptions) or is_class(self) then
                   if (oo_has_vmt in c.objectoptions) or is_class(self) then
@@ -3907,7 +3910,8 @@ implementation
                tObjectSymtable(symtable).datasize:=align(tObjectSymtable(symtable).datasize,sizeof(aint));
                tObjectSymtable(symtable).datasize:=align(tObjectSymtable(symtable).datasize,sizeof(aint));
 
 
              vmt_offset:=tObjectSymtable(symtable).datasize;
              vmt_offset:=tObjectSymtable(symtable).datasize;
-             inc(tObjectSymtable(symtable).datasize,sizeof(aint));
+             tObjectSymtable(symtable).datasize:=
+               tObjectSymtable(symtable).datasize+sizeof(aint);
              include(objectoptions,oo_has_vmt);
              include(objectoptions,oo_has_vmt);
           end;
           end;
      end;
      end;