mirror of
https://github.com/lua/lua
synced 2026-09-26 16:17:11 +03:00
Bug: wrong initialization in result from 'gmatch'
Function returned by 'string.gmatch' can be left in an inconsistent state after an error.
This commit is contained in:
parent
b18086ea34
commit
e282da498c
1 changed files with 1 additions and 2 deletions
|
|
@ -757,7 +757,6 @@ static int nospecials (const char *p, size_t l) {
|
|||
static void prepstate (MatchState *ms, lua_State *L,
|
||||
const char *s, size_t ls, const char *p, size_t lp) {
|
||||
ms->L = L;
|
||||
ms->matchdepth = MAXCCALLS;
|
||||
ms->src_init = s;
|
||||
ms->src_end = s + ls;
|
||||
ms->p_end = p + lp;
|
||||
|
|
@ -765,8 +764,8 @@ static void prepstate (MatchState *ms, lua_State *L,
|
|||
|
||||
|
||||
static void reprepstate (MatchState *ms) {
|
||||
ms->matchdepth = MAXCCALLS;
|
||||
ms->level = 0;
|
||||
lua_assert(ms->matchdepth == MAXCCALLS);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue