remove l_G from Proto

This commit is contained in:
Cloud Wu
2019-06-17 11:21:01 +08:00
committed by 云风
parent 744fbea7ee
commit c80b462412
4 changed files with 1 additions and 10 deletions

View File

@@ -1018,13 +1018,8 @@ LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data,
LUA_API void lua_clonefunction (lua_State *L, const void * fp) {
LClosure *cl;
LClosure *f = cast(LClosure *, fp);
api_check(L, isshared(gcvalue(f->p)), "Not a shared proto");
lua_lock(L);
if (f->p->l_G == G(L)) {
setclLvalue(L,L->top,f);
api_incr_top(L);
lua_unlock(L);
return;
}
cl = luaF_newLclosure(L,f->nupvalues);
setclLvalue(L,L->top,cl);
api_incr_top(L);