From 5ecb31003f8086f057444468d0356771526ec7b4 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Sat, 29 Apr 2017 15:09:17 -0300 Subject: [PATCH] bug: cannot "skip" labels after if-goto before the jump over the 'then' part --- lparser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lparser.c b/lparser.c index f78f64bd..af5891c2 100644 --- a/lparser.c +++ b/lparser.c @@ -1,5 +1,5 @@ /* -** $Id: lparser.c,v 2.156 2017/04/20 19:53:55 roberto Exp roberto $ +** $Id: lparser.c,v 2.157 2017/04/28 20:57:45 roberto Exp roberto $ ** Lua Parser ** See Copyright Notice in lua.h */ @@ -1400,7 +1400,7 @@ static void test_then_block (LexState *ls, int *escapelist) { 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 */ + while (testnext(ls, ';')) {} /* skip colons */ if (block_follow(ls, 0)) { /* 'goto' is the entire block? */ leaveblock(fs); return; /* and that is it */