fix match intern mt and stackvalues

This commit is contained in:
zixun
2019-10-21 11:38:08 +08:00
committed by 云风
parent 8a1d7006eb
commit f17c17b8c7
2 changed files with 37 additions and 18 deletions

View File

@@ -92,17 +92,15 @@ lco_stackvalues(lua_State* L) {
luaL_checktype(L, 2, LUA_TTABLE);
n = lua_gettop(cL);
if(n > 0) {
lua_checkstack(L, n+1);
luaL_checkstack(L, n+1, NULL);
int top = lua_gettop(L);
lua_xmove(cL, L, n);
int i=0;
for(i=0; i<n; i++) {
lua_pushvalue(L, top+1+i);
lua_seti(L, 2, i+1);
for(i=1; i<=n; i++) {
lua_pushvalue(L, top+i);
lua_seti(L, 2, i);
}
lua_xmove(L, cL, n);
} else {
n = 0;
}
}