diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-11-03 13:47:30 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-11-03 13:47:30 -0200 |
commit | 46de77b219e381ff8553fdba0f52b319c00ea1e1 (patch) | |
tree | 3b703e4df3dd2b69f0f768153fc75d2336d98bdb /ltm.c | |
parent | d356183402e214f4859cd6508964d4b5e781c598 (diff) | |
download | lua-46de77b219e381ff8553fdba0f52b319c00ea1e1.tar.gz lua-46de77b219e381ff8553fdba0f52b319c00ea1e1.tar.bz2 lua-46de77b219e381ff8553fdba0f52b319c00ea1e1.zip |
bug: despite its name, 'luaH_getstr' did not work for strings in
general, but only for short strings
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.34 2015/03/30 15:42:27 roberto Exp roberto $ | 2 | ** $Id: ltm.c,v 2.35 2015/11/02 18:48:07 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 | */ |
@@ -57,7 +57,7 @@ void luaT_init (lua_State *L) { | |||
57 | ** tag methods | 57 | ** tag methods |
58 | */ | 58 | */ |
59 | const TValue *luaT_gettm (Table *events, TMS event, TString *ename) { | 59 | const TValue *luaT_gettm (Table *events, TMS event, TString *ename) { |
60 | const TValue *tm = luaH_getstr(events, ename); | 60 | const TValue *tm = luaH_getshortstr(events, ename); |
61 | lua_assert(event <= TM_EQ); | 61 | lua_assert(event <= TM_EQ); |
62 | if (ttisnil(tm)) { /* no tag method? */ | 62 | if (ttisnil(tm)) { /* no tag method? */ |
63 | events->flags |= cast_byte(1u<<event); /* cache this fact */ | 63 | events->flags |= cast_byte(1u<<event); /* cache this fact */ |
@@ -79,7 +79,7 @@ const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) { | |||
79 | default: | 79 | default: |
80 | mt = G(L)->mt[ttnov(o)]; | 80 | mt = G(L)->mt[ttnov(o)]; |
81 | } | 81 | } |
82 | return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : luaO_nilobject); | 82 | return (mt ? luaH_getshortstr(mt, G(L)->tmname[event]) : luaO_nilobject); |
83 | } | 83 | } |
84 | 84 | ||
85 | 85 | ||