File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -398,7 +398,7 @@ pub unsafe extern "C" fn safe_xpcall(state: *mut ffi::lua_State) -> c_int {
398
398
}
399
399
}
400
400
401
- // Does not call checkstack , uses 1 stack space
401
+ // Does not call lua_checkstack , uses 1 stack space.
402
402
pub unsafe fn main_state ( state : * mut ffi:: lua_State ) -> * mut ffi:: lua_State {
403
403
ffi:: lua_rawgeti ( state, ffi:: LUA_REGISTRYINDEX , ffi:: LUA_RIDX_MAINTHREAD ) ;
404
404
let main_state = ffi:: lua_tothread ( state, -1 ) ;
@@ -420,12 +420,13 @@ pub unsafe fn push_wrapped_error(state: *mut ffi::lua_State, err: Error) {
420
420
421
421
// Pops a WrappedError off of the top of the stack, if it is a WrappedError. If it is not a
422
422
// WrappedError, returns None and does not pop anything. Uses 2 stack spaces and does not call
423
- // lua_checkstack
423
+ // lua_checkstack.
424
424
pub unsafe fn pop_wrapped_error ( state : * mut ffi:: lua_State ) -> Option < Error > {
425
425
if !is_wrapped_error ( state, -1 ) {
426
426
None
427
427
} else {
428
428
let err = & * get_userdata :: < WrappedError > ( state, -1 ) ;
429
+ // We are assuming here that Error::clone() cannot panic.
429
430
let err = err. 0 . clone ( ) ;
430
431
ffi:: lua_pop ( state, 1 ) ;
431
432
Some ( err)
You can’t perform that action at this time.
0 commit comments