]> git.lizzy.rs Git - rust.git/commitdiff
std::rt::backtrace: Fix backtrace on Win64
authorklutzy <klutzytheklutzy@gmail.com>
Thu, 18 Sep 2014 13:37:46 +0000 (22:37 +0900)
committerklutzy <klutzytheklutzy@gmail.com>
Thu, 18 Sep 2014 13:53:38 +0000 (22:53 +0900)
`struct CONTEXT` and its substructs require 16-byte alignment.

src/libstd/rt/backtrace.rs

index 5557ef9943b864d996a49a34824d7b3a9b9d4340..f4887a143d1dc74ce721264384caa3711898c44b 100644 (file)
@@ -831,9 +831,11 @@ pub fn init_frame(frame: &mut super::STACKFRAME64,
     mod arch {
         use libc::{c_longlong, c_ulonglong};
         use libc::types::os::arch::extra::{WORD, DWORD, DWORDLONG};
+        use simd;
 
         #[repr(C)]
         pub struct CONTEXT {
+            _align_hack: [simd::u64x2, ..0], // FIXME align on 16-byte
             P1Home: DWORDLONG,
             P2Home: DWORDLONG,
             P3Home: DWORDLONG,
@@ -892,12 +894,14 @@ pub struct CONTEXT {
 
         #[repr(C)]
         pub struct M128A {
+            _align_hack: [simd::u64x2, ..0], // FIXME align on 16-byte
             Low:  c_ulonglong,
             High: c_longlong
         }
 
         #[repr(C)]
         pub struct FLOATING_SAVE_AREA {
+            _align_hack: [simd::u64x2, ..0], // FIXME align on 16-byte
             _Dummy: [u8, ..512] // FIXME: Fill this out
         }