Apply second and third patch from http://lua.org/bugs.html.

This commit is contained in:
mbalmer 2016-03-25 08:15:20 +00:00
parent bb83bac5d1
commit fbad720175
2 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: lparser.c,v 1.4 2016/01/28 14:41:39 lneto Exp $ */
/* $NetBSD: lparser.c,v 1.5 2016/03/25 08:15:20 mbalmer Exp $ */
/*
** Id: lparser.c,v 2.149 2015/11/02 16:09:30 roberto Exp
@ -1240,7 +1240,7 @@ static void labelstat (LexState *ls, TString *label, int line) {
checkrepeated(fs, ll, label); /* check for repeated labels */
checknext(ls, TK_DBCOLON); /* skip double colon */
/* create new entry for this label */
l = newlabelentry(ls, ll, label, line, fs->pc);
l = newlabelentry(ls, ll, label, line, luaK_getlabel(fs));
skipnoopstat(ls); /* skip other no-op statements */
if (block_follow(ls, 0)) { /* label is last no-op statement in the block? */
/* assume that locals are already out of scope */

View File

@ -1,4 +1,4 @@
/* $NetBSD: lstrlib.c,v 1.11 2016/01/28 14:41:39 lneto Exp $ */
/* $NetBSD: lstrlib.c,v 1.12 2016/03/25 08:15:20 mbalmer Exp $ */
/*
** Id: lstrlib.c,v 1.239 2015/11/25 16:28:17 roberto Exp
@ -692,6 +692,7 @@ typedef struct GMatchState {
static int gmatch_aux (lua_State *L) {
GMatchState *gm = (GMatchState *)lua_touserdata(L, lua_upvalueindex(3));
const char *src;
gm->ms.L = L;
for (src = gm->src; src <= gm->ms.src_end; src++) {
const char *e;
reprepstate(&gm->ms);