summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-06-20 16:19:09 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-06-20 16:19:09 -0300
commit6402bfb1f84391cab2c55bad45fec0f82da3c359 (patch)
treefb603fda551804d0cd415432f8b3ec0e7a65a91c
parent27b6bbdcf3de2c8a1d4fcd20d7fd9f4b950e71d3 (diff)
downloadlua-github-6402bfb1f84391cab2c55bad45fec0f82da3c359.tar.gz
better error message for dostring (2nd argument)
-rw-r--r--inout.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/inout.c b/inout.c
index 7d9d5cea..64e018d7 100644
--- a/inout.c
+++ b/inout.c
@@ -5,7 +5,7 @@
** Also provides some predefined lua functions.
*/
-char *rcs_inout="$Id: inout.c,v 2.64 1997/06/19 18:04:34 roberto Exp roberto $";
+char *rcs_inout="$Id: inout.c,v 2.65 1997/06/19 18:49:40 roberto Exp roberto $";
#include <stdio.h>
#include <string.h>
@@ -152,6 +152,8 @@ static void lua_internaldostring (void)
{
lua_Object err = lua_getparam(2);
if (err != LUA_NOOBJECT) { /* set new error method */
+ luaL_arg_check(lua_isnil(err) || lua_isfunction(err), 2,
+ "must be a valid error handler");
lua_pushobject(err);
err = lua_seterrormethod();
}