Browse Source

* check whether the hdef is still a procvardef before accessing it as such

Sven/Sarah Barth 2 years ago
parent
commit
c43f671baa
1 changed files with 2 additions and 2 deletions
  1. 2 2
      compiler/pdecvar.pas

+ 2 - 2
compiler/pdecvar.pas

@@ -1546,7 +1546,7 @@ implementation
                begin
                begin
                  { Parse procvar directives after ; }
                  { Parse procvar directives after ; }
                  maybe_parse_proc_directives(hdef);
                  maybe_parse_proc_directives(hdef);
-                 if po_is_function_ref in tprocvardef(hdef).procoptions then
+                 if (hdef.typ=procvardef) and (po_is_function_ref in tprocvardef(hdef).procoptions) then
                    begin
                    begin
                      if not (m_function_references in current_settings.modeswitches) and
                      if not (m_function_references in current_settings.modeswitches) and
                          not (po_is_block in tprocvardef(hdef).procoptions) then
                          not (po_is_block in tprocvardef(hdef).procoptions) then
@@ -1865,7 +1865,7 @@ implementation
                  (hdef.typesym=nil)
                  (hdef.typesym=nil)
                ) or is_funcref(hdef) then
                ) or is_funcref(hdef) then
                begin
                begin
-                 if po_is_function_ref in tprocvardef(hdef).procoptions then
+                 if (hdef.typ=procvardef) and (po_is_function_ref in tprocvardef(hdef).procoptions) then
                    begin
                    begin
                      if not (m_function_references in current_settings.modeswitches) and
                      if not (m_function_references in current_settings.modeswitches) and
                          not (po_is_block in tprocvardef(hdef).procoptions) then
                          not (po_is_block in tprocvardef(hdef).procoptions) then