** t[k] = value at the top of the stack (where 'k' is a string) */
| 741 | ** t[k] = value at the top of the stack (where 'k' is a string) |
| 742 | */ |
| 743 | static void auxsetstr (lua_State *L, const TValue *t, const char *k) { |
| 744 | const TValue *slot; |
| 745 | TString *str = luaS_new(L, k); |
| 746 | api_checknelems(L, 1); |
| 747 | if (luaV_fastset(L, t, str, slot, luaH_getstr, L->top - 1)) |
| 748 | L->top--; /* pop value */ |
| 749 | else { |
| 750 | setsvalue2s(L, L->top, str); /* push 'str' (to make it a TValue) */ |
| 751 | api_incr_top(L); |
| 752 | luaV_finishset(L, t, L->top - 1, L->top - 2, slot); |
| 753 | L->top -= 2; /* pop value and key */ |
| 754 | } |
| 755 | lua_unlock(L); /* lock done by caller */ |
| 756 | } |
| 757 | |
| 758 | |
| 759 | LUA_API void lua_setglobal (lua_State *L, const char *name) { |
no test coverage detected