diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-03-14 15:30:54 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-03-14 15:30:54 -0300 |
commit | b56d4e570a60a8e84df8288c3122eb5bb5c20af6 (patch) | |
tree | d5597a7865712fc407adbb41fe0749e728617ca7 /lgc.c | |
parent | 9eca305e75010e30342486a4139846faf1b3eccb (diff) | |
download | lua-b56d4e570a60a8e84df8288c3122eb5bb5c20af6.tar.gz lua-b56d4e570a60a8e84df8288c3122eb5bb5c20af6.tar.bz2 lua-b56d4e570a60a8e84df8288c3122eb5bb5c20af6.zip |
Changes in the warning system
- The warning functions get an extra parameter that tells whether
message is to be continued (instead of using end-of-lines as a signal).
- The user data for the warning function is a regular value, instead
of a writable slot inside the Lua state.
Diffstat (limited to '')
-rw-r--r-- | lgc.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -832,7 +832,7 @@ static void GCTM (lua_State *L) { | |||
832 | lua_assert(!g->gcemergency); | 832 | lua_assert(!g->gcemergency); |
833 | setgcovalue(L, &v, udata2finalize(g)); | 833 | setgcovalue(L, &v, udata2finalize(g)); |
834 | tm = luaT_gettmbyobj(L, &v, TM_GC); | 834 | tm = luaT_gettmbyobj(L, &v, TM_GC); |
835 | if (tm != NULL && ttisfunction(tm)) { /* is there a finalizer? */ | 835 | if (ttisfunction(tm)) { /* is the finalizer a function? */ |
836 | int status; | 836 | int status; |
837 | lu_byte oldah = L->allowhook; | 837 | lu_byte oldah = L->allowhook; |
838 | int running = g->gcrunning; | 838 | int running = g->gcrunning; |
@@ -850,9 +850,9 @@ static void GCTM (lua_State *L) { | |||
850 | const char *msg = (ttisstring(s2v(L->top - 1))) | 850 | const char *msg = (ttisstring(s2v(L->top - 1))) |
851 | ? svalue(s2v(L->top - 1)) | 851 | ? svalue(s2v(L->top - 1)) |
852 | : "error object is not a string"; | 852 | : "error object is not a string"; |
853 | luaE_warning(L, "error in __gc metamethod ("); | 853 | luaE_warning(L, "error in __gc metamethod (", 1); |
854 | luaE_warning(L, msg); | 854 | luaE_warning(L, msg, 1); |
855 | luaE_warning(L, ")\n"); | 855 | luaE_warning(L, ")", 0); |
856 | } | 856 | } |
857 | } | 857 | } |
858 | } | 858 | } |