diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-12-19 14:40:17 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-12-19 14:40:17 -0200 |
| commit | 4dc0be950ad67e4385400aacd25e10325a2a6e59 (patch) | |
| tree | 9d201a8d3725f7130740bb574f7e19d8ad3c4d96 /ltm.c | |
| parent | 3153a41e330a624fccfb7b9ade576767619b4a6b (diff) | |
| download | lua-4dc0be950ad67e4385400aacd25e10325a2a6e59.tar.gz lua-4dc0be950ad67e4385400aacd25e10325a2a6e59.tar.bz2 lua-4dc0be950ad67e4385400aacd25e10325a2a6e59.zip | |
new macro 'isLuacode' (to distinguish regular Lua code from
hooks, where C code can run inside a Lua function).
Diffstat (limited to 'ltm.c')
| -rw-r--r-- | ltm.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltm.c,v 2.52 2017/12/13 18:32:09 roberto Exp roberto $ | 2 | ** $Id: ltm.c,v 2.53 2017/12/15 13:07:10 roberto Exp roberto $ |
| 3 | ** Tag methods | 3 | ** Tag methods |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -108,7 +108,7 @@ void luaT_callTM (lua_State *L, const TValue *f, const TValue *p1, | |||
| 108 | setobj2s(L, func + 3, p3); /* 3rd argument */ | 108 | setobj2s(L, func + 3, p3); /* 3rd argument */ |
| 109 | L->top += 4; | 109 | L->top += 4; |
| 110 | /* metamethod may yield only when called from Lua code */ | 110 | /* metamethod may yield only when called from Lua code */ |
| 111 | if (isLua(L->ci)) | 111 | if (isLuacode(L->ci)) |
| 112 | luaD_call(L, func, 0); | 112 | luaD_call(L, func, 0); |
| 113 | else | 113 | else |
| 114 | luaD_callnoyield(L, func, 0); | 114 | luaD_callnoyield(L, func, 0); |
| @@ -124,7 +124,7 @@ void luaT_callTMres (lua_State *L, const TValue *f, const TValue *p1, | |||
| 124 | setobj2s(L, func + 2, p2); /* 2nd argument */ | 124 | setobj2s(L, func + 2, p2); /* 2nd argument */ |
| 125 | L->top += 3; | 125 | L->top += 3; |
| 126 | /* metamethod may yield only when called from Lua code */ | 126 | /* metamethod may yield only when called from Lua code */ |
| 127 | if (isLua(L->ci)) | 127 | if (isLuacode(L->ci)) |
| 128 | luaD_call(L, func, 1); | 128 | luaD_call(L, func, 1); |
| 129 | else | 129 | else |
| 130 | luaD_callnoyield(L, func, 1); | 130 | luaD_callnoyield(L, func, 1); |
