mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 05:59:27 +02:00
Handle NIL entries in deflist after commit 48986
git-svn-id: trunk@49230 -
This commit is contained in:
parent
70760208bb
commit
e6045673ee
@ -813,6 +813,9 @@ uses
|
|||||||
st : TSymtable;
|
st : TSymtable;
|
||||||
i : longint;
|
i : longint;
|
||||||
begin
|
begin
|
||||||
|
{ since commit 48986 deflist might have NIL entries }
|
||||||
|
if not assigned(def) then
|
||||||
|
exit;
|
||||||
case def.typ of
|
case def.typ of
|
||||||
procdef:
|
procdef:
|
||||||
tprocdef(def).forwarddef:=false;
|
tprocdef(def).forwarddef:=false;
|
||||||
|
@ -618,6 +618,9 @@ implementation
|
|||||||
for i:=current_module.localsymtable.deflist.count-1 downto 0 do
|
for i:=current_module.localsymtable.deflist.count-1 downto 0 do
|
||||||
begin
|
begin
|
||||||
def:=tdef(current_module.localsymtable.deflist[i]);
|
def:=tdef(current_module.localsymtable.deflist[i]);
|
||||||
|
{ since commit 48986 deflist might have NIL entries }
|
||||||
|
if not assigned(def) then
|
||||||
|
continue;
|
||||||
{ this also frees def, as the defs are owned by the symtable }
|
{ this also frees def, as the defs are owned by the symtable }
|
||||||
if not def.is_registered and
|
if not def.is_registered and
|
||||||
not(df_not_registered_no_free in def.defoptions) then
|
not(df_not_registered_no_free in def.defoptions) then
|
||||||
|
@ -70,14 +70,18 @@ implementation
|
|||||||
procedure TLLVMMachineCodePlaygroundAssembler.WriteImports;
|
procedure TLLVMMachineCodePlaygroundAssembler.WriteImports;
|
||||||
var
|
var
|
||||||
i : integer;
|
i : integer;
|
||||||
|
def : tdef;
|
||||||
proc : tprocdef;
|
proc : tprocdef;
|
||||||
list : TAsmList;
|
list : TAsmList;
|
||||||
cur_unit: tused_unit;
|
cur_unit: tused_unit;
|
||||||
begin
|
begin
|
||||||
for i:=0 to current_module.deflist.Count-1 do
|
for i:=0 to current_module.deflist.Count-1 do
|
||||||
if assigned(current_module.deflist[i]) and (tdef(current_module.deflist[i]).typ=procdef) then
|
|
||||||
begin
|
begin
|
||||||
proc := tprocdef(current_module.deflist[i]);
|
def:=tdef(current_module.deflist[i]);
|
||||||
|
{ since commit 48986 deflist might have NIL entries }
|
||||||
|
if assigned(def) and (def.typ=procdef) then
|
||||||
|
begin
|
||||||
|
proc := tprocdef(def);
|
||||||
if (po_external in proc.procoptions) and assigned(proc.import_dll) then
|
if (po_external in proc.procoptions) and assigned(proc.import_dll) then
|
||||||
begin
|
begin
|
||||||
//WriteProcDef(proc);
|
//WriteProcDef(proc);
|
||||||
@ -95,6 +99,7 @@ implementation
|
|||||||
writer.AsmWriteLn(proc.import_name^);
|
writer.AsmWriteLn(proc.import_name^);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
list:=TAsmList.Create;
|
list:=TAsmList.Create;
|
||||||
cur_unit:=tused_unit(usedunits.First);
|
cur_unit:=tused_unit(usedunits.First);
|
||||||
while assigned(cur_unit) do
|
while assigned(cur_unit) do
|
||||||
|
@ -957,14 +957,17 @@ implementation
|
|||||||
procedure TWabtTextAssembler.WriteImports;
|
procedure TWabtTextAssembler.WriteImports;
|
||||||
var
|
var
|
||||||
i : integer;
|
i : integer;
|
||||||
|
def : tdef;
|
||||||
proc : tprocdef;
|
proc : tprocdef;
|
||||||
sym : tsym;
|
sym : tsym;
|
||||||
j : integer;
|
j : integer;
|
||||||
psym : tprocsym;
|
psym : tprocsym;
|
||||||
begin
|
begin
|
||||||
for i:=0 to current_module.deflist.Count-1 do begin
|
for i:=0 to current_module.deflist.Count-1 do begin
|
||||||
if tdef(current_module.deflist[i]).typ = procdef then begin
|
def:=tdef(current_module.deflist[i]);
|
||||||
proc := tprocdef(current_module.deflist[i]);
|
{ since commit 48986 deflist might have NIL entries }
|
||||||
|
if assigned(def) and (def.typ=procdef) then begin
|
||||||
|
proc := tprocdef(def);
|
||||||
if (po_external in proc.procoptions) and assigned(proc.import_dll) then begin
|
if (po_external in proc.procoptions) and assigned(proc.import_dll) then begin
|
||||||
writer.AsmWrite(#9'(import "');
|
writer.AsmWrite(#9'(import "');
|
||||||
writer.AsmWrite(proc.import_dll^);
|
writer.AsmWrite(proc.import_dll^);
|
||||||
|
Loading…
Reference in New Issue
Block a user