diff options
Diffstat (limited to '')
-rw-r--r-- | lapi.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -440,7 +440,7 @@ LUA_API lua_Unsigned lua_rawlen (lua_State *L, int idx) { | |||
440 | case LUA_VSHRSTR: return cast(lua_Unsigned, tsvalue(o)->shrlen); | 440 | case LUA_VSHRSTR: return cast(lua_Unsigned, tsvalue(o)->shrlen); |
441 | case LUA_VLNGSTR: return cast(lua_Unsigned, tsvalue(o)->u.lnglen); | 441 | case LUA_VLNGSTR: return cast(lua_Unsigned, tsvalue(o)->u.lnglen); |
442 | case LUA_VUSERDATA: return cast(lua_Unsigned, uvalue(o)->len); | 442 | case LUA_VUSERDATA: return cast(lua_Unsigned, uvalue(o)->len); |
443 | case LUA_VTABLE: return luaH_getn(hvalue(o)); | 443 | case LUA_VTABLE: return luaH_getn(L, hvalue(o)); |
444 | default: return 0; | 444 | default: return 0; |
445 | } | 445 | } |
446 | } | 446 | } |
@@ -593,12 +593,8 @@ LUA_API const char *lua_pushfstring (lua_State *L, const char *fmt, ...) { | |||
593 | const char *ret; | 593 | const char *ret; |
594 | va_list argp; | 594 | va_list argp; |
595 | lua_lock(L); | 595 | lua_lock(L); |
596 | va_start(argp, fmt); | 596 | pushvfstring(L, argp, fmt, ret); |
597 | ret = luaO_pushvfstring(L, fmt, argp); | ||
598 | va_end(argp); | ||
599 | luaC_checkGC(L); | 597 | luaC_checkGC(L); |
600 | if (ret == NULL) /* error? */ | ||
601 | luaD_throw(L, LUA_ERRMEM); | ||
602 | lua_unlock(L); | 598 | lua_unlock(L); |
603 | return ret; | 599 | return ret; |
604 | } | 600 | } |
@@ -683,7 +679,7 @@ static int auxgetstr (lua_State *L, const TValue *t, const char *k) { | |||
683 | 679 | ||
684 | /* | 680 | /* |
685 | ** The following function assumes that the registry cannot be a weak | 681 | ** The following function assumes that the registry cannot be a weak |
686 | ** table, so that en mergency collection while using the global table | 682 | ** table; so, an emergency collection while using the global table |
687 | ** cannot collect it. | 683 | ** cannot collect it. |
688 | */ | 684 | */ |
689 | static void getGlobalTable (lua_State *L, TValue *gt) { | 685 | static void getGlobalTable (lua_State *L, TValue *gt) { |