| 958 | /* -- Object setters ------------------------------------------------------ */ |
| 959 | |
| 960 | LUA_API void lua_settable(lua_State *L, int idx) |
| 961 | { |
| 962 | TValue *o; |
| 963 | cTValue *t = index2adr_check(L, idx); |
| 964 | lj_checkapi_slot(2); |
| 965 | o = lj_meta_tset(L, t, L->top-2); |
| 966 | if (o) { |
| 967 | /* NOBARRIER: lj_meta_tset ensures the table is not black. */ |
| 968 | L->top -= 2; |
| 969 | copyTV(L, o, L->top+1); |
| 970 | } else { |
| 971 | TValue *base = L->top; |
| 972 | copyTV(L, base+2, base-3-2*LJ_FR2); |
| 973 | L->top = base+3; |
| 974 | lj_vm_call(L, base, 0+1); |
| 975 | L->top -= 3+LJ_FR2; |
| 976 | } |
| 977 | } |
| 978 | |
| 979 | LUA_API void lua_setfield(lua_State *L, int idx, const char *k) |
| 980 | { |
no test coverage detected