Browse Source

* do not set nonlocal for inter-procedural labels, this is not needed, they use
the jmpbuf to reach the target

git-svn-id: trunk@46907 -

florian 4 years ago
parent
commit
0bdc1fdea4
3 changed files with 4 additions and 9 deletions
  1. 0 1
      compiler/nflw.pas
  2. 2 4
      compiler/pexpr.pas
  3. 2 4
      compiler/pstatmnt.pas

+ 0 - 1
compiler/nflw.pas

@@ -2202,7 +2202,6 @@ implementation
 
                     if assigned(labelsym.jumpbuf) then
                       begin
-                        labelsym.nonlocal:=true;
                         result:=ccallnode.createintern('fpc_longjmp',
                           ccallparanode.create(cordconstnode.create(1,sinttype,true),
                           ccallparanode.create(cloadnode.create(labelsym.jumpbuf,labelsym.jumpbuf.owner),

+ 2 - 4
compiler/pexpr.pas

@@ -3390,12 +3390,10 @@ implementation
                           Message(sym_e_label_already_defined);
                         if symtablestack.top.symtablelevel<>srsymtable.symtablelevel then
                           begin
-                            tlabelsym(srsym).nonlocal:=true;
                             include(current_procinfo.flags,pi_has_interproclabel);
+                            if (current_procinfo.procdef.proctypeoption in [potype_unitinit,potype_unitfinalize]) then
+                              Message(sym_e_interprocgoto_into_init_final_code_not_allowed);
                           end;
-                        if tlabelsym(srsym).nonlocal and
-                          (current_procinfo.procdef.proctypeoption in [potype_unitinit,potype_unitfinalize]) then
-                          Message(sym_e_interprocgoto_into_init_final_code_not_allowed);
                         tlabelsym(srsym).defined:=true;
                         p1:=clabelnode.create(nil,tlabelsym(srsym));
                         tlabelsym(srsym).code:=p1;

+ 2 - 4
compiler/pstatmnt.pas

@@ -1281,12 +1281,10 @@ implementation
                      Message(sym_e_label_already_defined);
                    if symtablestack.top.symtablelevel<>srsymtable.symtablelevel then
                      begin
-                       tlabelsym(srsym).nonlocal:=true;
                        include(current_procinfo.flags,pi_has_interproclabel);
+                       if (current_procinfo.procdef.proctypeoption in [potype_unitinit,potype_unitfinalize]) then
+                         Message(sym_e_interprocgoto_into_init_final_code_not_allowed);
                      end;
-                   if tlabelsym(srsym).nonlocal and
-                     (current_procinfo.procdef.proctypeoption in [potype_unitinit,potype_unitfinalize]) then
-                     Message(sym_e_interprocgoto_into_init_final_code_not_allowed);
 
                    tlabelsym(srsym).defined:=true;
                    p:=clabelnode.create(nil,tlabelsym(srsym));