Skip to content

Commit 4e6d60c

Browse files
committed
Fix alloc size
1 parent 979d1a2 commit 4e6d60c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

library/panic_unwind/src/emcc.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ pub unsafe fn cleanup(ptr: *mut u8) -> Box<dyn Any + Send> {
9595
}
9696

9797
pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 {
98-
let sz = mem::size_of_val(&data);
99-
let exception = __cxa_allocate_exception(sz) as *mut Exception;
98+
let exception = __cxa_allocate_exception(mem::size_of::<Exception>()) as *mut Exception;
10099
if exception.is_null() {
101100
return uw::_URC_FATAL_PHASE1_ERROR as u32;
102101
}

0 commit comments

Comments
 (0)