mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-02 05:29:34 +01:00
* when assigning an anonymous function to a method pointer move the function to the normal function level to avoid potential problems when accessing other variables
This commit is contained in:
parent
a6ddea87b7
commit
d410deb7ae
@ -2501,6 +2501,11 @@ implementation
|
||||
) then
|
||||
internalerror(2021060801);
|
||||
|
||||
{ we know this only captures Self, so we can move the
|
||||
anonymous function to normal function level }
|
||||
pd.parast.symtablelevel:=normal_function_level;
|
||||
tprocdef(pd).localst.symtablelevel:=normal_function_level;
|
||||
|
||||
selfsym:=nil;
|
||||
fpsym:=nil;
|
||||
{ find the framepointer parameter and an eventual self }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user