Skip to content

Commit

Permalink
This is a missing argcheck, add it back in as a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
bobtfish committed Sep 19, 2022
1 parent 933c5ca commit 97e14f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lbaselib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ unsafe extern "C" fn luaB_getmetatable(L: *mut lua_State) -> c_int {
}

unsafe extern "C" fn luaB_setmetatable(L: *mut lua_State) -> c_int {
let _t = lua_type(L, 2);
luaL_checktype(L, 1, LUA_TTABLE);
// FIXME
//luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2,
// "nil or table expected");
if luaL_getmetafield(L, 1, cstr!("__metatable")) != LUA_TNIL {
luaL_error(L, cstr!("cannot change a protected metatable"));
}
Expand Down

0 comments on commit 97e14f6

Please sign in to comment.