diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-07-26 14:59:39 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-07-26 14:59:39 -0300 |
| commit | b80077b8f3e27a94c6afa895b41a9f8b52c42e61 (patch) | |
| tree | 8a7c21ee0acfed553ef1d92bdfd7b1f728f35a91 /ltm.h | |
| parent | e70f275f32a5339a86be6f8b9d08c20cb874b205 (diff) | |
| download | lua-b80077b8f3e27a94c6afa895b41a9f8b52c42e61.tar.gz lua-b80077b8f3e27a94c6afa895b41a9f8b52c42e61.tar.bz2 lua-b80077b8f3e27a94c6afa895b41a9f8b52c42e61.zip | |
Change in the handling of 'L->top' when calling metamethods
Instead of updating 'L->top' in every place that may call a
metamethod, the metamethod functions themselves (luaT_trybinTM and
luaT_callorderTM) correct the top. (When calling metamethods from
the C API, however, the callers must preserve 'L->top'.)
Diffstat (limited to 'ltm.h')
| -rw-r--r-- | ltm.h | 1 |
1 files changed, 1 insertions, 0 deletions
| @@ -75,6 +75,7 @@ LUAI_FUNC void luaT_callTMres (lua_State *L, const TValue *f, | |||
| 75 | const TValue *p1, const TValue *p2, StkId p3); | 75 | const TValue *p1, const TValue *p2, StkId p3); |
| 76 | LUAI_FUNC void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2, | 76 | LUAI_FUNC void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2, |
| 77 | StkId res, TMS event); | 77 | StkId res, TMS event); |
| 78 | LUAI_FUNC void luaT_tryconcatTM (lua_State *L); | ||
| 78 | LUAI_FUNC void luaT_trybinassocTM (lua_State *L, const TValue *p1, | 79 | LUAI_FUNC void luaT_trybinassocTM (lua_State *L, const TValue *p1, |
| 79 | const TValue *p2, StkId res, int inv, TMS event); | 80 | const TValue *p2, StkId res, int inv, TMS event); |
| 80 | LUAI_FUNC void luaT_trybiniTM (lua_State *L, const TValue *p1, lua_Integer i2, | 81 | LUAI_FUNC void luaT_trybiniTM (lua_State *L, const TValue *p1, lua_Integer i2, |
