lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


When Lua stack has one element, doing lua_replace(L,1) removes that element. (I'd expect the stack to be left unchanged.)

int test(lua_State*L) {
  lua_settop(L, 0);
  lua_pushnumber(L, 0);
  lua_replace(L, 1);
  printf("%d\n", lua_gettop(L)); // 0 is printed
  return 0;
}

--
Shmuel