2
0
Эх сурвалжийг харах

compiler: don't create a parasymtable for property if property has no parameters

git-svn-id: trunk@19550 -
paul 13 жил өмнө
parent
commit
62b4ef3d1a

+ 2 - 2
compiler/pdecvar.pas

@@ -401,6 +401,7 @@ implementation
                 not (m_delphi in current_settings.modeswitches) then
                 Message(parser_e_cant_publish_that_property);
               { create a list of the parameters }
+              p.parast:=tparasymtable.create(nil,0);
               symtablestack.push(p.parast);
               sc:=TFPObjectList.create(false);
               repeat
@@ -513,10 +514,9 @@ implementation
                   p.index:=tpropertysym(overridden).index;
                   p.default:=tpropertysym(overridden).default;
                   p.propoptions:=tpropertysym(overridden).propoptions;
-                  p.parast.free;
-                  p.parast:=tpropertysym(overridden).parast.getcopy;
                   if ppo_hasparameters in p.propoptions then
                     begin
+                      p.parast:=tpropertysym(overridden).parast.getcopy;
                       add_parameters(p,readprocdef,writeprocdef);
                       paranr:=p.parast.SymList.Count;
                     end;

+ 1 - 1
compiler/ppu.pas

@@ -43,7 +43,7 @@ type
 {$endif Test_Double_checksum}
 
 const
-  CurrentPPUVersion = 138;
+  CurrentPPUVersion = 139;
 
 { buffer sizes }
   maxentrysize = 1024;

+ 12 - 6
compiler/symsym.pas

@@ -957,7 +957,7 @@ implementation
          default:=0;
          propdef:=nil;
          indexdef:=nil;
-         parast:=tparasymtable.create(nil,0);
+         parast:=nil;
          for pap:=low(tpropaccesslisttypes) to high(tpropaccesslisttypes) do
            propaccesslist[pap]:=tpropaccesslist.create;
       end;
@@ -976,8 +976,11 @@ implementation
          ppufile.getderef(indexdefderef);
          for pap:=low(tpropaccesslisttypes) to high(tpropaccesslisttypes) do
            propaccesslist[pap]:=ppufile.getpropaccesslist;
-         parast:=tparasymtable.create(nil,0);
-         tparasymtable(parast).ppuload(ppufile);
+         if ppo_hasparameters in propoptions then
+           begin
+             parast:=tparasymtable.create(nil,0);
+             tparasymtable(parast).ppuload(ppufile);
+           end;
       end;
 
 
@@ -1001,7 +1004,8 @@ implementation
         indexdefderef.build(indexdef);
         for pap:=low(tpropaccesslisttypes) to high(tpropaccesslisttypes) do
           propaccesslist[pap].buildderef;
-        tparasymtable(parast).buildderef;
+        if assigned(parast) then
+          tparasymtable(parast).buildderef;
       end;
 
 
@@ -1014,7 +1018,8 @@ implementation
         propdef:=tdef(propdefderef.resolve);
         for pap:=low(tpropaccesslisttypes) to high(tpropaccesslisttypes) do
           propaccesslist[pap].resolve;
-        tparasymtable(parast).deref;
+        if assigned(parast) then
+          tparasymtable(parast).deref;
       end;
 
 
@@ -1038,7 +1043,8 @@ implementation
         for pap:=low(tpropaccesslisttypes) to high(tpropaccesslisttypes) do
           ppufile.putpropaccesslist(propaccesslist[pap]);
         ppufile.writeentry(ibpropertysym);
-        tparasymtable(parast).ppuwrite(ppufile);
+        if ppo_hasparameters in propoptions then
+          tparasymtable(parast).ppuwrite(ppufile);
       end;