diff options
| -rw-r--r-- | ldo.c | 4 | ||||
| -rw-r--r-- | manual/manual.of | 13 |
2 files changed, 13 insertions, 4 deletions
| @@ -203,7 +203,7 @@ TStatus luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) { | |||
| 203 | #define ERRORSTACKSIZE (MAXSTACK + STACKERRSPACE) | 203 | #define ERRORSTACKSIZE (MAXSTACK + STACKERRSPACE) |
| 204 | 204 | ||
| 205 | 205 | ||
| 206 | /* raise an error while running the message handler */ | 206 | /* raise a stack error while running the message handler */ |
| 207 | l_noret luaD_errerr (lua_State *L) { | 207 | l_noret luaD_errerr (lua_State *L) { |
| 208 | TString *msg = luaS_newliteral(L, "error in error handling"); | 208 | TString *msg = luaS_newliteral(L, "error in error handling"); |
| 209 | setsvalue2s(L, L->top.p, msg); | 209 | setsvalue2s(L, L->top.p, msg); |
| @@ -339,7 +339,7 @@ int luaD_growstack (lua_State *L, int n, int raiseerror) { | |||
| 339 | a stack error; cannot grow further than that. */ | 339 | a stack error; cannot grow further than that. */ |
| 340 | lua_assert(stacksize(L) == ERRORSTACKSIZE); | 340 | lua_assert(stacksize(L) == ERRORSTACKSIZE); |
| 341 | if (raiseerror) | 341 | if (raiseerror) |
| 342 | luaD_errerr(L); /* error inside message handler */ | 342 | luaD_errerr(L); /* stack error inside message handler */ |
| 343 | return 0; /* if not 'raiseerror', just signal it */ | 343 | return 0; /* if not 'raiseerror', just signal it */ |
| 344 | } | 344 | } |
| 345 | else if (n < MAXSTACK) { /* avoids arithmetic overflows */ | 345 | else if (n < MAXSTACK) { /* avoids arithmetic overflows */ |
diff --git a/manual/manual.of b/manual/manual.of index 89e9b8f4..3c704118 100644 --- a/manual/manual.of +++ b/manual/manual.of | |||
| @@ -270,7 +270,7 @@ print(x) --> 10 (the global one) | |||
| 270 | 270 | ||
| 271 | Notice that, in a declaration like @T{local x = x}, | 271 | Notice that, in a declaration like @T{local x = x}, |
| 272 | the new @id{x} being declared is not in scope yet, | 272 | the new @id{x} being declared is not in scope yet, |
| 273 | and so the @id{x} in the right-hand side refers to the outside variable. | 273 | and so the @id{x} on the right-hand side refers to the outside variable. |
| 274 | 274 | ||
| 275 | Because of the @x{lexical scoping} rules, | 275 | Because of the @x{lexical scoping} rules, |
| 276 | local variables can be freely accessed by functions | 276 | local variables can be freely accessed by functions |
| @@ -2826,7 +2826,16 @@ status codes to indicate different kinds of errors or other conditions: | |||
| 2826 | For such errors, Lua does not call the @x{message handler}. | 2826 | For such errors, Lua does not call the @x{message handler}. |
| 2827 | } | 2827 | } |
| 2828 | 2828 | ||
| 2829 | @item{@defid{LUA_ERRERR}| error while running the @x{message handler}.} | 2829 | @item{@defid{LUA_ERRERR}| |
| 2830 | stack overflow while running the @x{message handler} | ||
| 2831 | due to another stack overflow. | ||
| 2832 | More often than not, | ||
| 2833 | this error is the result of some other error while running | ||
| 2834 | a message handler. | ||
| 2835 | An error in a message handler will call the handler again, | ||
| 2836 | which will generate the error again, and so on, | ||
| 2837 | until this loop exhausts the stack and cause this error. | ||
| 2838 | } | ||
| 2830 | 2839 | ||
| 2831 | @item{@defid{LUA_ERRSYNTAX}| syntax error during precompilation | 2840 | @item{@defid{LUA_ERRSYNTAX}| syntax error during precompilation |
| 2832 | or format error in a binary chunk.} | 2841 | or format error in a binary chunk.} |
