Przeglądaj źródła

* the adjusted nested function needs to access the parent function for the capturer

Sven/Sarah Barth 1 rok temu
rodzic
commit
ca0323d4ca
1 zmienionych plików z 3 dodań i 0 usunięć
  1. 3 0
      compiler/procdefutil.pas

+ 3 - 0
compiler/procdefutil.pas

@@ -990,6 +990,9 @@ implementation
           pd.funcretsym:=pinested.procdef.funcretsym;
           pd.funcretsym:=pinested.procdef.funcretsym;
           pinested.procdef.funcretsym:=nil;
           pinested.procdef.funcretsym:=nil;
           insert_funcret_local(pinested.procdef);
           insert_funcret_local(pinested.procdef);
+          { the nested function needs access to the parent's framepointer to
+            access the capturer }
+          insert_parentfp_para(pinested.procdef);
         end;
         end;
       capturedef.symtable.insertsym(ps);
       capturedef.symtable.insertsym(ps);
       owner.addnestedproc(pi);
       owner.addnestedproc(pi);