]> git.lizzy.rs Git - rust.git/blobdiff - src/libpanic_unwind/emcc.rs
Rollup merge of #68123 - crlf0710:linked_list_cursor, r=Amanieu
[rust.git] / src / libpanic_unwind / emcc.rs
index 0f93140238bc424a3af25cb7a3b6c778150e4a9a..9161d49959cf5cc1577264dcdb1502cde151115a 100644 (file)
@@ -88,8 +88,12 @@ pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 {
 }
 extern "C" fn exception_cleanup(ptr: *mut libc::c_void) -> DestructorRet {
     unsafe {
-        ptr::drop_in_place(ptr as *mut Exception);
-        super::__rust_drop_panic();
+        if let Some(b) = (ptr as *mut Exception).read().data {
+            drop(b);
+            super::__rust_drop_panic();
+        }
+        #[cfg(any(target_arch = "arm", target_arch = "wasm32"))]
+        ptr
     }
 }