aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ldo.c8
-rw-r--r--loadlib.c9
-rw-r--r--lvm.c2
-rw-r--r--manual/manual.of4
4 files changed, 17 insertions, 6 deletions
diff --git a/ldo.c b/ldo.c
index a48e35f9..8e4faf02 100644
--- a/ldo.c
+++ b/ldo.c
@@ -213,7 +213,7 @@ int luaD_reallocstack (lua_State *L, int newsize, int raiseerror) {
213 213
214 214
215/* 215/*
216** Try to grow the stack by at least 'n' elements. when 'raiseerror' 216** Try to grow the stack by at least 'n' elements. When 'raiseerror'
217** is true, raises any error; otherwise, return 0 in case of errors. 217** is true, raises any error; otherwise, return 0 in case of errors.
218*/ 218*/
219int luaD_growstack (lua_State *L, int n, int raiseerror) { 219int luaD_growstack (lua_State *L, int n, int raiseerror) {
@@ -247,6 +247,10 @@ int luaD_growstack (lua_State *L, int n, int raiseerror) {
247} 247}
248 248
249 249
250/*
251** Compute how much of the stack is being used, by computing the
252** maximum top of all call frames in the stack and the current top.
253*/
250static int stackinuse (lua_State *L) { 254static int stackinuse (lua_State *L) {
251 CallInfo *ci; 255 CallInfo *ci;
252 int res; 256 int res;
@@ -254,7 +258,7 @@ static int stackinuse (lua_State *L) {
254 for (ci = L->ci; ci != NULL; ci = ci->previous) { 258 for (ci = L->ci; ci != NULL; ci = ci->previous) {
255 if (lim < ci->top) lim = ci->top; 259 if (lim < ci->top) lim = ci->top;
256 } 260 }
257 lua_assert(lim <= L->stack_last); 261 lua_assert(lim <= L->stack_last + EXTRA_STACK);
258 res = cast_int(lim - L->stack) + 1; /* part of stack in use */ 262 res = cast_int(lim - L->stack) + 1; /* part of stack in use */
259 if (res < LUA_MINSTACK) 263 if (res < LUA_MINSTACK)
260 res = LUA_MINSTACK; /* ensure a minimum size */ 264 res = LUA_MINSTACK; /* ensure a minimum size */
diff --git a/loadlib.c b/loadlib.c
index 6f9fa373..d792dffa 100644
--- a/loadlib.c
+++ b/loadlib.c
@@ -708,8 +708,13 @@ static const luaL_Reg ll_funcs[] = {
708 708
709 709
710static void createsearcherstable (lua_State *L) { 710static void createsearcherstable (lua_State *L) {
711 static const lua_CFunction searchers[] = 711 static const lua_CFunction searchers[] = {
712 {searcher_preload, searcher_Lua, searcher_C, searcher_Croot, NULL}; 712 searcher_preload,
713 searcher_Lua,
714 searcher_C,
715 searcher_Croot,
716 NULL
717 };
713 int i; 718 int i;
714 /* create 'searchers' table */ 719 /* create 'searchers' table */
715 lua_createtable(L, sizeof(searchers)/sizeof(searchers[0]) - 1, 0); 720 lua_createtable(L, sizeof(searchers)/sizeof(searchers[0]) - 1, 0);
diff --git a/lvm.c b/lvm.c
index f3a5662b..e8c2e962 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1177,7 +1177,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
1177 printf("line: %d\n", luaG_getfuncline(cl->p, pcRel(pc, cl->p))); 1177 printf("line: %d\n", luaG_getfuncline(cl->p, pcRel(pc, cl->p)));
1178 #endif 1178 #endif
1179 lua_assert(base == ci->func + 1); 1179 lua_assert(base == ci->func + 1);
1180 lua_assert(base <= L->top && L->top < L->stack_last); 1180 lua_assert(base <= L->top && L->top <= L->stack_last);
1181 /* invalidate top for instructions not expecting it */ 1181 /* invalidate top for instructions not expecting it */
1182 lua_assert(isIT(i) || (cast_void(L->top = base), 1)); 1182 lua_assert(isIT(i) || (cast_void(L->top = base), 1));
1183 vmdispatch (GET_OPCODE(i)) { 1183 vmdispatch (GET_OPCODE(i)) {
diff --git a/manual/manual.of b/manual/manual.of
index 15f207fa..bd648c6c 100644
--- a/manual/manual.of
+++ b/manual/manual.of
@@ -3981,6 +3981,7 @@ Also @N{returns 0} if any of the indices are not valid.
3981 3981
3982Similar to @Lid{lua_gettable}, but does a raw access 3982Similar to @Lid{lua_gettable}, but does a raw access
3983(i.e., without metamethods). 3983(i.e., without metamethods).
3984The value at @id{index} must be a table.
3984 3985
3985} 3986}
3986 3987
@@ -4027,6 +4028,7 @@ For other values, this call @N{returns 0}.
4027 4028
4028Similar to @Lid{lua_settable}, but does a raw assignment 4029Similar to @Lid{lua_settable}, but does a raw assignment
4029(i.e., without metamethods). 4030(i.e., without metamethods).
4031The value at @id{index} must be a table.
4030 4032
4031} 4033}
4032 4034
@@ -7280,7 +7282,7 @@ according to the format string @id{fmt} @see{pack}.
7280 7282
7281@LibEntry{string.packsize (fmt)| 7283@LibEntry{string.packsize (fmt)|
7282 7284
7283Returns the size of a string resulting from @Lid{string.pack} 7285Returns the length of a string resulting from @Lid{string.pack}
7284with the given format. 7286with the given format.
7285The format string cannot have the variable-length options 7287The format string cannot have the variable-length options
7286@Char{s} or @Char{z} @see{pack}. 7288@Char{s} or @Char{z} @see{pack}.