aboutsummaryrefslogtreecommitdiff
path: root/lstate.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-08-16 09:51:54 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-08-16 09:51:54 -0300
commitca13be9af784b7288d3a07d9b5bccb329086e885 (patch)
treec027419f98064d681518a4130439920a13a11b06 /lstate.c
parenta1d8eb27431c02c4529be1efd92143ad65434f3a (diff)
downloadlua-ca13be9af784b7288d3a07d9b5bccb329086e885.tar.gz
lua-ca13be9af784b7288d3a07d9b5bccb329086e885.tar.bz2
lua-ca13be9af784b7288d3a07d9b5bccb329086e885.zip
Supressed errors in '__close' generate warnings
Diffstat (limited to 'lstate.c')
-rw-r--r--lstate.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lstate.c b/lstate.c
index d4bc53eb..86cd5fb8 100644
--- a/lstate.c
+++ b/lstate.c
@@ -443,3 +443,19 @@ void luaE_warning (lua_State *L, const char *msg, int tocont) {
443} 443}
444 444
445 445
446/*
447** Generate a warning from an error message
448*/
449void luaE_warnerror (lua_State *L, const char *where) {
450 TValue *errobj = s2v(L->top - 1); /* error object */
451 const char *msg = (ttisstring(errobj))
452 ? svalue(errobj)
453 : "error object is not a string";
454 /* produce warning "error in %s (%s)" (where, msg) */
455 luaE_warning(L, "error in ", 1);
456 luaE_warning(L, where, 1);
457 luaE_warning(L, " (", 1);
458 luaE_warning(L, msg, 1);
459 luaE_warning(L, ")", 0);
460}
461