mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 16:09:27 +02:00
* fix #41063: don't add classrefdefs or objectdefs to the WPOInfo if they are declared locally (e.g. capturer instances)
+ added test
This commit is contained in:
parent
291d2e911a
commit
32b3477fe2
@ -8724,7 +8724,8 @@ implementation
|
||||
if not classref_created_in_current_module then
|
||||
begin
|
||||
classref_created_in_current_module:=true;
|
||||
current_module.wpoinfo.addcreatedobjtypeforclassref(self);
|
||||
if not (owner.symtabletype in [localsymtable]) then
|
||||
current_module.wpoinfo.addcreatedobjtypeforclassref(self);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -8734,7 +8735,8 @@ implementation
|
||||
if not created_in_current_module then
|
||||
begin
|
||||
created_in_current_module:=true;
|
||||
current_module.wpoinfo.addcreatedobjtype(self);
|
||||
if not (owner.symtabletype in [localsymtable]) then
|
||||
current_module.wpoinfo.addcreatedobjtype(self);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
11
tests/webtbs/tw41063.pp
Normal file
11
tests/webtbs/tw41063.pp
Normal file
@ -0,0 +1,11 @@
|
||||
{ %wpoparas=optvmts }
|
||||
{ %wpopasses=1 }
|
||||
|
||||
program tw41063;
|
||||
{$mode objfpc}{$h+}
|
||||
|
||||
uses uw41063;
|
||||
|
||||
begin
|
||||
end.
|
||||
|
22
tests/webtbs/uw41063.pp
Normal file
22
tests/webtbs/uw41063.pp
Normal file
@ -0,0 +1,22 @@
|
||||
unit uw41063;
|
||||
|
||||
{$mode objfpc}{$h+}
|
||||
{$modeswitch functionreferences}
|
||||
|
||||
interface
|
||||
|
||||
type
|
||||
TMyClass = class
|
||||
FProcRef: reference to procedure;
|
||||
procedure proc;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
procedure TMyClass.proc;
|
||||
begin
|
||||
FProcRef := @proc;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user