diff options
Diffstat (limited to 'src/lj_meta.c')
-rw-r--r-- | src/lj_meta.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lj_meta.c b/src/lj_meta.c index dff01f85..1182d908 100644 --- a/src/lj_meta.c +++ b/src/lj_meta.c | |||
@@ -60,7 +60,7 @@ cTValue *lj_meta_lookup(lua_State *L, cTValue *o, MMS mm) | |||
60 | else if (tvisudata(o)) | 60 | else if (tvisudata(o)) |
61 | mt = tabref(udataV(o)->metatable); | 61 | mt = tabref(udataV(o)->metatable); |
62 | else | 62 | else |
63 | mt = tabref(G(L)->basemt[itypemap(o)]); | 63 | mt = tabref(basemt_obj(G(L), o)); |
64 | if (mt) { | 64 | if (mt) { |
65 | cTValue *mo = lj_tab_getstr(mt, strref(G(L)->mmname[mm])); | 65 | cTValue *mo = lj_tab_getstr(mt, strref(G(L)->mmname[mm])); |
66 | if (mo) | 66 | if (mo) |
@@ -157,7 +157,7 @@ static cTValue *str2num(cTValue *o, TValue *n) | |||
157 | { | 157 | { |
158 | if (tvisnum(o)) | 158 | if (tvisnum(o)) |
159 | return o; | 159 | return o; |
160 | else if (tvisstr(o) && lj_str_numconv(strVdata(o), n)) | 160 | else if (tvisstr(o) && lj_str_tonum(strV(o), n)) |
161 | return n; | 161 | return n; |
162 | else | 162 | else |
163 | return NULL; | 163 | return NULL; |
@@ -295,7 +295,7 @@ TValue *lj_meta_equal(lua_State *L, GCobj *o1, GCobj *o2, int ne) | |||
295 | top = curr_top(L); | 295 | top = curr_top(L); |
296 | setcont(top, ne ? lj_cont_condf : lj_cont_condt); | 296 | setcont(top, ne ? lj_cont_condf : lj_cont_condt); |
297 | copyTV(L, top+1, mo); | 297 | copyTV(L, top+1, mo); |
298 | it = o1->gch.gct == ~LJ_TTAB ? LJ_TTAB : LJ_TUDATA; | 298 | it = ~o1->gch.gct; |
299 | setgcV(L, top+2, &o1->gch, it); | 299 | setgcV(L, top+2, &o1->gch, it); |
300 | setgcV(L, top+3, &o2->gch, it); | 300 | setgcV(L, top+3, &o2->gch, it); |
301 | return top+2; /* Trigger metamethod call. */ | 301 | return top+2; /* Trigger metamethod call. */ |