* fixed infinite Java assembler writer create loop after r31625

git-svn-id: trunk@31666 -
This commit is contained in:
Jonas Maebe 2015-09-13 19:06:22 +00:00
parent 0ea38852ac
commit f4c868b06a

View File

@ -1078,11 +1078,22 @@ implementation
nestedstructs.free;
end;
constructor TJasminAssembler.Create(info: pasminfo; smart: boolean);
begin
inherited CreateWithWriter(info,TJasminAssemblerOutputFile.Create(self),true,smart);
InstrWriter:=TJasminInstrWriter.Create(self);
asmfiles:=TCmdStrList.Create;
{ this is a bit dirty: the "main" constructor is is this one, which is
called by TExternalAssembler.CreateWithWriter(). That means the call
below to CreateWithWriter will end up here again when it calls create.
It will first initialise fwriter though, so we can check that field,
and otherwise call the inherited create }
if not assigned(writer) then
begin
CreateWithWriter(info,TJasminAssemblerOutputFile.Create(self),true,smart);
InstrWriter:=TJasminInstrWriter.Create(self);
asmfiles:=TCmdStrList.Create;
end
else
inherited;
end;