Browse Source

Fix bug report 24612:
hermes package has compile error with introduced at r24910.
Solved by checking that the procdef is not declared forward.

git-svn-id: trunk@24912 -

pierre 12 years ago
parent
commit
91bc424694
1 changed files with 9 additions and 1 deletions
  1. 9 1
      compiler/pdecsub.pas

+ 9 - 1
compiler/pdecsub.pas

@@ -2928,8 +2928,16 @@ const
            else
            else
             break;
             break;
          end;
          end;
+         { nostackframe requires assembler, but assembler
+           may be specified in the implementation part only,
+           and in not required if the function is first forward declared
+           if it is a procdef that has forwardef set to true
+           we postpone the possible error message to the real implementation
+           parse_only does not need to be considered as po_nostackframe
+           is an implementation only directive  }
          if (po_nostackframe in pd.procoptions) and
          if (po_nostackframe in pd.procoptions) and
-            not (po_assembler in pd.procoptions) then
+            not (po_assembler in pd.procoptions) and
+            ((pd.typ<>procdef) or not tprocdef(pd).forwarddef) then
            message(parser_e_nostackframe_without_assembler);
            message(parser_e_nostackframe_without_assembler);
       end;
       end;