mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-17 13:59:29 +02:00
* as a workaround for some compiler bug introduced during 3.1.1 the freeing of the management operator offset entry lists is moved to a nested procedure as that does not trigger the bug (even with -O2 or -O3)
git-svn-id: trunk@39711 -
This commit is contained in:
parent
ba08bdc9b1
commit
92cce05f5f
@ -1175,22 +1175,45 @@ implementation
|
||||
|
||||
|
||||
destructor tabstractrecordsymtable.destroy;
|
||||
|
||||
{ for some reason a compiler built with 3.3.1 fails building the libxml2
|
||||
package if the below define is not defined and thus the code snippet is
|
||||
part of the destructor itself and not a nested procedure; until that bug
|
||||
is fixed this is used as a workaround :/ }
|
||||
{$define codegen_workaround}
|
||||
{$ifdef codegen_workaround}
|
||||
procedure free_mop_list(mop:tmanagementoperator);
|
||||
var
|
||||
i : longint;
|
||||
begin
|
||||
if assigned(mop_list[mop]) then
|
||||
for i:=0 to mop_list[mop].count-1 do
|
||||
dispose(pmanagementoperator_offset_entry(mop_list[mop][i]));
|
||||
mop_list[mop].free;
|
||||
end;
|
||||
{$endif codegen_workaround}
|
||||
|
||||
var
|
||||
mop : tmanagementoperator;
|
||||
mopofs : pmanagementoperator_offset_entry;
|
||||
{$ifndef codegen_workaround}
|
||||
i : longint;
|
||||
{$endif codegen_workaround}
|
||||
begin
|
||||
if refcount>1 then
|
||||
exit;
|
||||
{$ifdef llvm}
|
||||
fllvmst.free;
|
||||
{$endif llvm}
|
||||
for mop in tmanagementoperator do
|
||||
for mop:=low(tmanagementoperator) to high(tmanagementoperator) do
|
||||
begin
|
||||
{$ifdef codegen_workaround}
|
||||
free_mop_list(mop);
|
||||
{$else codegen_workaround}
|
||||
if assigned(mop_list[mop]) then
|
||||
for i:=0 to mop_list[mop].count-1 do
|
||||
dispose(pmanagementoperator_offset_entry(mop_list[mop][i]));
|
||||
mop_list[mop].free;
|
||||
{$endif codegen_workaround}
|
||||
end;
|
||||
inherited destroy;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user