瀏覽代碼

* ensure that a nested function variable can not be assigned to a function reference

Sven/Sarah Barth 3 年之前
父節點
當前提交
3b7842c30e
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      compiler/procdefutil.pas

+ 6 - 0
compiler/procdefutil.pas

@@ -895,6 +895,12 @@ implementation
                 internalerror(2022041804);
             end;
         end
+      else if (n.resultdef.typ=procvardef) and
+          (po_delphi_nested_cc in tprocvardef(n.resultdef).procoptions) then
+        begin
+          MessagePos(n.fileinfo,type_e_nested_procvar_to_funcref);
+          exit;
+        end
       else
         pinested:=nil;