lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> > if true then
> >   goto LBL
> >   ::loop::
> >   print(2)
> >   ::LBL::
> >   print(3)
> >   goto loop
> > end
> > 
> > It's a bug, only print(3) once.
> 
> Thanks for the report. We will have a look at it.

A quick-and-slightly-dirty solution:

--- lparser.c	2016/08/01 19:51:24	2.155
+++ lparser.c	2017/04/19 18:01:54
@@ -1392,7 +1392,6 @@
     luaK_goiffalse(ls->fs, &v);  /* will jump to label if condition is true */
     enterblock(fs, &bl, 0);  /* must enter block before 'goto' */
     gotostat(ls, v.t);  /* handle goto/break */
-    skipnoopstat(ls);  /* skip other no-op statements */
     if (block_follow(ls, 0)) {  /* 'goto' is the entire block? */
       leaveblock(fs);
       return;  /* and that is it */


-- Roberto