浏览代码

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

Sven/Sarah Barth 1 年之前
父节点
当前提交
ca0323d4ca
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      compiler/procdefutil.pas

+ 3 - 0
compiler/procdefutil.pas

@@ -990,6 +990,9 @@ implementation
           pd.funcretsym:=pinested.procdef.funcretsym;
           pinested.procdef.funcretsym:=nil;
           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;
       capturedef.symtable.insertsym(ps);
       owner.addnestedproc(pi);