mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2026-01-07 01:10:33 +01:00
Ensure that no garbage for specialization code is written in case of "-al"
assemble.pas, TExternalAssembler.WriteSourceLine: * also respect a module change which can happen if the generated assembler code belongs to a specialized generic git-svn-id: trunk@23628 -
This commit is contained in:
parent
30247d8961
commit
b219638284
@ -704,11 +704,21 @@ Implementation
|
||||
end;
|
||||
|
||||
procedure TExternalAssembler.WriteSourceLine(hp: tailineinfo);
|
||||
var
|
||||
module : tmodule;
|
||||
begin
|
||||
{ load infile }
|
||||
if lastfileinfo.fileindex<>hp.fileinfo.fileindex then
|
||||
if (lastfileinfo.moduleindex<>hp.fileinfo.moduleindex) or
|
||||
(lastfileinfo.fileindex<>hp.fileinfo.fileindex) then
|
||||
begin
|
||||
infile:=current_module.sourcefiles.get_file(hp.fileinfo.fileindex);
|
||||
{ in case of a generic the module can be different }
|
||||
if current_module.unit_index=hp.fileinfo.moduleindex then
|
||||
module:=current_module
|
||||
else
|
||||
module:=get_module(hp.fileinfo.moduleindex);
|
||||
if not assigned(module) then
|
||||
internalerror(2013021801);
|
||||
infile:=module.sourcefiles.get_file(hp.fileinfo.fileindex);
|
||||
if assigned(infile) then
|
||||
begin
|
||||
{ open only if needed !! }
|
||||
@ -717,6 +727,7 @@ Implementation
|
||||
end;
|
||||
{ avoid unnecessary reopens of the same file !! }
|
||||
lastfileinfo.fileindex:=hp.fileinfo.fileindex;
|
||||
lastfileinfo.moduleindex:=hp.fileinfo.moduleindex;
|
||||
{ be sure to change line !! }
|
||||
lastfileinfo.line:=-1;
|
||||
end;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user