浏览代码

* allow iso gotos within a procedure

git-svn-id: trunk@46396 -
florian 5 年之前
父节点
当前提交
61d44bba17
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      compiler/nflw.pas

+ 2 - 2
compiler/nflw.pas

@@ -2179,7 +2179,7 @@ implementation
               { nested exits don't need the non local goto switch }
               { nested exits don't need the non local goto switch }
               (labelsym.realname='$nestedexit') then
               (labelsym.realname='$nestedexit') then
               begin
               begin
-                if current_procinfo.procdef.parast.symtablelevel>labelsym.owner.symtablelevel then
+                if current_procinfo.procdef.parast.symtablelevel>=labelsym.owner.symtablelevel then
                   begin
                   begin
                     { don't mess with the exception blocks, global gotos in/out side exception blocks are not allowed }
                     { don't mess with the exception blocks, global gotos in/out side exception blocks are not allowed }
                     if exceptionblock>0 then
                     if exceptionblock>0 then
@@ -2212,7 +2212,7 @@ implementation
                       CGMessage1(cg_e_goto_label_not_found,labelsym.realname);
                       CGMessage1(cg_e_goto_label_not_found,labelsym.realname);
                   end
                   end
                 else
                 else
-                  CGMessage(cg_e_interprocedural_goto_only_to_outer_scope_allowed);
+                  CGMessagePos(self.fileinfo,cg_e_interprocedural_goto_only_to_outer_scope_allowed);
               end
               end
             else
             else
               CGMessage1(cg_e_goto_label_not_found,labelsym.realname);
               CGMessage1(cg_e_goto_label_not_found,labelsym.realname);