]> git.lizzy.rs Git - rust.git/blobdiff - library/panic_unwind/src/emcc.rs
Rollup merge of #103706 - zbyrn:issue-101637-fix, r=estebank
[rust.git] / library / panic_unwind / src / emcc.rs
index 57e817ce6ad5449e6c81f28ca50ec6ad6643db5a..c6d42308596cb2f51ba91c7bc3485a16872413c1 100644 (file)
@@ -95,8 +95,7 @@ struct CatchData {
 }
 
 pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 {
-    let sz = mem::size_of_val(&data);
-    let exception = __cxa_allocate_exception(sz) as *mut Exception;
+    let exception = __cxa_allocate_exception(mem::size_of::<Exception>()) as *mut Exception;
     if exception.is_null() {
         return uw::_URC_FATAL_PHASE1_ERROR as u32;
     }