aboutsummaryrefslogtreecommitdiff
path: root/src/lj_meta.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lj_meta.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/lj_meta.c b/src/lj_meta.c
index b33cb88d..de2b4068 100644
--- a/src/lj_meta.c
+++ b/src/lj_meta.c
@@ -315,19 +315,13 @@ TValue * LJ_FASTCALL lj_meta_len(lua_State *L, cTValue *o)
315{ 315{
316 cTValue *mo = lj_meta_lookup(L, o, MM_len); 316 cTValue *mo = lj_meta_lookup(L, o, MM_len);
317 if (tvisnil(mo)) { 317 if (tvisnil(mo)) {
318#ifdef LUAJIT_ENABLE_LUA52COMPAT 318 if (LJ_52 && tvistab(o))
319 if (tvistab(o))
320 tabref(tabV(o)->metatable)->nomm |= (uint8_t)(1u<<MM_len); 319 tabref(tabV(o)->metatable)->nomm |= (uint8_t)(1u<<MM_len);
321 else 320 else
322#endif
323 lj_err_optype(L, o, LJ_ERR_OPLEN); 321 lj_err_optype(L, o, LJ_ERR_OPLEN);
324 return NULL; 322 return NULL;
325 } 323 }
326#ifdef LUAJIT_ENABLE_LUA52COMPAT 324 return mmcall(L, lj_cont_ra, mo, o, LJ_52 ? o : niltv(L));
327 return mmcall(L, lj_cont_ra, mo, o, o);
328#else
329 return mmcall(L, lj_cont_ra, mo, o, niltv(L));
330#endif
331} 325}
332 326
333/* Helper for equality comparisons. __eq metamethod. */ 327/* Helper for equality comparisons. __eq metamethod. */