Skip to content

Commit e904d52

Browse files
committed
Add commented out type check as noted by @khvzak
1 parent 742adb6 commit e904d52

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/lbaselib.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,10 @@ unsafe extern "C" fn luaB_getmetatable(L: *mut lua_State) -> c_int {
167167

168168
unsafe extern "C" fn luaB_setmetatable(L: *mut lua_State) -> c_int {
169169
let _t = lua_type(L, 2);
170-
// TODO: FIX
171-
luaL_checktype(L, 1, LUA_TTABLE); // FIXME? t is unused?
170+
luaL_checktype(L, 1, LUA_TTABLE);
171+
// FIXME
172+
//luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2,
173+
// "nil or table expected");
172174
if luaL_getmetafield(L, 1, cstr!("__metatable")) != LUA_TNIL {
173175
luaL_error(L, cstr!("cannot change a protected metatable"));
174176
}
@@ -396,7 +398,7 @@ unsafe extern "C" fn generic_reader(
396398
}
397399

398400
unsafe extern "C" fn luaB_load(L: *mut lua_State) -> c_int {
399-
let status;
401+
let status: c_int;
400402
let mut l: size_t = 0;
401403
let s = lua_tolstring(L, 1 as c_int, &mut l);
402404
let mode = luaL_optstring(L, 3, cstr!("bt"));

0 commit comments

Comments
 (0)