about summary refs log tree commit diff
path: root/library/panic_unwind/src
diff options
context:
space:
mode:
authorGary Guo <gary@garyguo.net>2022-10-12 12:24:59 +0100
committerGary Guo <gary@garyguo.net>2022-10-23 20:30:16 +0100
commit4e6d60c837e178950b844bd1235c67ebbb6a5899 (patch)
tree1623cfcc51294568ab8818b41099bbda823cb368 /library/panic_unwind/src
parent979d1a2c78a3fd45807eb28ccff5aeea37128e0f (diff)
downloadrust-4e6d60c837e178950b844bd1235c67ebbb6a5899.tar.gz
rust-4e6d60c837e178950b844bd1235c67ebbb6a5899.zip
Fix alloc size
Diffstat (limited to 'library/panic_unwind/src')
-rw-r--r--library/panic_unwind/src/emcc.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/library/panic_unwind/src/emcc.rs b/library/panic_unwind/src/emcc.rs
index 57e817ce6ad..c6d42308596 100644
--- a/library/panic_unwind/src/emcc.rs
+++ b/library/panic_unwind/src/emcc.rs
@@ -95,8 +95,7 @@ pub unsafe fn cleanup(ptr: *mut u8) -> Box<dyn Any + Send> {
 }
 
 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;
     }