From 29aa25a48b04534ec71f072e7c9fe183d7c8bdf9 Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Mon, 4 Nov 2019 22:23:09 +0000 Subject: [PATCH] Dont take wrapped panic in error_tostring() --- src/util.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util.rs b/src/util.rs index 513d35f..4e0b64f 100644 --- a/src/util.rs +++ b/src/util.rs @@ -526,7 +526,7 @@ pub unsafe fn init_error_registry(state: *mut ffi::lua_State) { Ok(err_buf) } else if is_wrapped_panic(state, -1) { let panic = get_userdata::(state, -1); - if let Some(p) = (*panic).0.take() { + if let Some(ref p) = (*panic).0 { ffi::lua_pushlightuserdata( state, &ERROR_PRINT_BUFFER_KEY as *const u8 as *mut c_void, @@ -547,7 +547,7 @@ pub unsafe fn init_error_registry(state: *mut ffi::lua_State) { let _ = write!(&mut (*err_buf), "{}", error); Ok(err_buf) } else { - mlua_panic!("error during panic handling, panic was resumed twice") + mlua_panic!("error during panic handling, panic was resumed") } } else { // I'm not sure whether this is possible to trigger without bugs in mlua?