Skip to content

Commit 0d70d57

Browse files
committed
std::rt::backtrace: Fix backtrace on Win64
`struct CONTEXT` and its substructs require 16-byte alignment.
1 parent 9508faa commit 0d70d57

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libstd/rt/backtrace.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,9 +831,11 @@ mod imp {
831831
mod arch {
832832
use libc::{c_longlong, c_ulonglong};
833833
use libc::types::os::arch::extra::{WORD, DWORD, DWORDLONG};
834+
use simd;
834835

835836
#[repr(C)]
836837
pub struct CONTEXT {
838+
_align_hack: [simd::u64x2, ..0], // FIXME align on 16-byte
837839
P1Home: DWORDLONG,
838840
P2Home: DWORDLONG,
839841
P3Home: DWORDLONG,
@@ -892,12 +894,14 @@ mod imp {
892894

893895
#[repr(C)]
894896
pub struct M128A {
897+
_align_hack: [simd::u64x2, ..0], // FIXME align on 16-byte
895898
Low: c_ulonglong,
896899
High: c_longlong
897900
}
898901

899902
#[repr(C)]
900903
pub struct FLOATING_SAVE_AREA {
904+
_align_hack: [simd::u64x2, ..0], // FIXME align on 16-byte
901905
_Dummy: [u8, ..512] // FIXME: Fill this out
902906
}
903907

0 commit comments

Comments
 (0)