From a97f29f15487c5f584185f646f9cfc06a04b26ca Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 29 Aug 2000 17:43:28 -0300 Subject: explicit stack control in the API --- lstrlib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lstrlib.c') diff --git a/lstrlib.c b/lstrlib.c index c380359b..0a0a6c13 100644 --- a/lstrlib.c +++ b/lstrlib.c @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.46 2000/08/09 19:16:57 roberto Exp roberto $ +** $Id: lstrlib.c,v 1.47 2000/08/28 17:57:04 roberto Exp roberto $ ** Standard library for string operations and pattern-matching ** See Copyright Notice in lua.h */ @@ -400,6 +400,7 @@ static const char *lmemfind (const char *s1, size_t l1, static int push_captures (lua_State *L, struct Capture *cap) { int i; + luaL_checkstack(L, cap->level, "too many captures"); for (i=0; ilevel; i++) { int l = cap->capture[i].len; if (l == -1) lua_error(L, "unfinished capture"); -- cgit v1.2.3-55-g6feb