From 62b4ef3d1a99a9b5e04536226c17ea018fb432e4 Mon Sep 17 00:00:00 2001 From: paul Date: Fri, 28 Oct 2011 01:38:55 +0000 Subject: [PATCH] compiler: don't create a parasymtable for property if property has no parameters git-svn-id: trunk@19550 - --- compiler/pdecvar.pas | 4 ++-- compiler/ppu.pas | 2 +- compiler/symsym.pas | 18 ++++++++++++------ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/compiler/pdecvar.pas b/compiler/pdecvar.pas index 96ddcad879..10a3e55635 100644 --- a/compiler/pdecvar.pas +++ b/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; diff --git a/compiler/ppu.pas b/compiler/ppu.pas index 9f6017d801..f69f0e13aa 100644 --- a/compiler/ppu.pas +++ b/compiler/ppu.pas @@ -43,7 +43,7 @@ type {$endif Test_Double_checksum} const - CurrentPPUVersion = 138; + CurrentPPUVersion = 139; { buffer sizes } maxentrysize = 1024; diff --git a/compiler/symsym.pas b/compiler/symsym.pas index 4f1554584b..5352213aea 100644 --- a/compiler/symsym.pas +++ b/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;